OEModule\OphCiExamination\models\OphCiExamination_Workflow_Rule::model PHP Méthode

model() public static méthode

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

Usage Example

 public function actionDeleteWorkflowRules()
 {
     if (is_array(@$_POST['workflowrules'])) {
         foreach ($_POST['workflowrules'] as $rule_id) {
             if ($rule = models\OphCiExamination_Workflow_Rule::model()->findByPk($rule_id)) {
                 if (!$rule->delete()) {
                     throw new \Exception('Unable to delete workflow rule: ' . print_r($rule->getErrors(), true));
                 }
             }
         }
     }
     echo '1';
 }