Specialty::model PHP Method

model() public static method

Returns the static model of the specified AR class.
public static model ( $className = __CLASS__ ) : Specialty
return Specialty the static model class
    public static function model($className = __CLASS__)
    {
        return parent::model($className);
    }

Usage Example

    public static function eventTypeProperties($event_type_id)
    {
        $event_type = EventType::model()->findByPk($event_type_id);
        $event_type_short_name = EventTypeModuleCode::getEventShortName($event_type);
        if (empty($_POST)) {
            if (!preg_match('/^([A-Z][a-z]+)([A-Z][a-z]+)([A-Z][a-zA-Z]+)$/', $event_type->class_name, $m)) {
                die("ERROR: {$event_type->class_name}");
            }
            $specialty_id = Specialty::model()->find('abbreviation=?', array(strtoupper($m[1])))->id;
            $event_group_id = EventGroup::model()->find('code=?', array($m[2]))->id;
            $event_type_name = $event_type->name;
        } else {
            $specialty_id = @$_REQUEST['Specialty']['id'];
            $event_group_id = @$_REQUEST['EventGroup']['id'];
            $event_type_name = @$_REQUEST['EventTypeModuleCode']['moduleSuffix'];
        }
        ?>
		<label>Specialty: </label>
		<?php 
        echo CHtml::dropDownList('Specialty[id]', $specialty_id, CHtml::listData(Specialty::model()->findAll(array('order' => 'name')), 'id', 'name'));
        ?>
<br/>
		<label>Event group: </label><?php 
        echo CHtml::dropDownList('EventGroup[id]', $event_group_id, CHtml::listData(EventGroup::model()->findAll(array('order' => 'name')), 'id', 'name'));
        ?>
<br />
		<label>Name of event type: </label> <?php 
        echo CHtml::textField('EventTypeModuleCode[moduleSuffix]', $event_type_name, array('size' => 65, 'id' => 'moduleSuffix'));
        ?>
<br />
		<label>Event type short name: </label> <?php 
        echo CHtml::textField('EventTypeModuleCode[moduleShortSuffix]', $event_type_short_name, array('size' => 65, 'id' => 'moduleShortSuffix'));
        ?>
<br />
		<?php 
    }
All Usage Examples Of Specialty::model