OEModule\PatientTicketing\models\Ticket::model PHP Méthode

model() public static méthode

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

Usage Example

 /**
  * @param \Patient $patient
  * @param bool     $active
  *
  * @return models\Ticket[]
  */
 public function getTicketsForPatient(\Patient $patient, $active = true)
 {
     $criteria = new \CDbCriteria(array('order' => 't.created_date desc'));
     $criteria->addColumnCondition(array('patient_id' => $patient->id));
     $tickets = models\Ticket::model()->with('current_queue')->findAll($criteria);
     if ($active) {
         $res = array();
         foreach ($tickets as $t) {
             if (!$t->is_complete()) {
                 $res[] = $t;
             }
         }
         return $res;
     } else {
         return $tickets;
     }
 }
All Usage Examples Of OEModule\PatientTicketing\models\Ticket::model