OphTrOperationbooking_ScheduleOperation_PatientUnavailableReason::model PHP Method

model() public static method

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

Usage Example

 /**
  * Retrieves all valid OphTrOperationBooking_ScheduleOperation_PatientUnavailableReason that can be used for this
  * instance (i.e. includes the current value even if its no longer active).
  *
  * @return OphTrOperationBooking_ScheduleOperation_PatientUnavailableReason[]
  */
 public function getPatientUnavailbleReasons()
 {
     $criteria = new CDbCriteria();
     $criteria->condition = 'enabled = true';
     $criteria->order = 'display_order asc';
     $reasons = OphTrOperationbooking_ScheduleOperation_PatientUnavailableReason::model()->findAll($criteria);
     // just use standard list
     if (!$this->reason_id) {
         return $reasons;
     }
     $all_reasons = array();
     $r_ids = array();
     foreach ($reasons as $reason) {
         $all_reasons[] = $reason;
         $r_ids[] = $reason->id;
     }
     if (!in_array($this->reason_id, $r_ids)) {
         $all_reasons[] = $this->reason;
     }
     return $all_reasons;
 }
All Usage Examples Of OphTrOperationbooking_ScheduleOperation_PatientUnavailableReason::model