model() public static method

Returns the static model of the specified AR class.
public static model ( $className = __CLASS__ ) : OphCiExamination_ElementSet
return OphCiExamination_ElementSet the static model class
Example #1
0
 public function actionSaveWorkflowStepName()
 {
     if (!($step = models\OphCiExamination_ElementSet::model()->find('workflow_id=? and id=?', array(@$_POST['workflow_id'], @$_POST['element_set_id'])))) {
         throw new \Exception('Unknown element set ' . @$_POST['element_set_id'] . ' for workflow ' . @$_POST['workflow_id']);
     }
     $step->name = @$_POST['step_name'];
     if (!$step->save()) {
         throw new \Exception('Unable to save element set: ' . print_r($step->getErrors(), true));
     }
     echo '1';
 }