OEModule\OphCiExamination\models\Element_OphCiExamination_Diagnoses::model PHP Method

model() public static method

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

Usage Example

 /**
  * gets a list of disorders diagnosed for the patient within the current episode, ordered by event creation date
  *
  * @param Patient $patient
  *
  * @return array() - list of associative arrays with disorder_id and eye_id defined
  */
 public function getOrderedDisorders($patient, $episode)
 {
     $events = $this->getEventsInEpisode($patient, $episode);
     $disorders = array();
     if ($events) {
         foreach (@$events as $event) {
             $criteria = new \CDbCriteria();
             $criteria->compare('event_id', $event->id);
             $diagnoses_el = models\Element_OphCiExamination_Diagnoses::model()->find($criteria);
             if ($diagnoses_el) {
                 foreach ($diagnoses_el->diagnoses as $diagnosis) {
                     $disorders[] = array('disorder_id' => $diagnosis->disorder_id, 'eye_id' => $diagnosis->eye_id);
                 }
             }
         }
     }
     return $disorders;
 }