OEModule\PatientTicketing\models\TicketAssignOutcomeOption::model PHP Method

model() public static method

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

Usage Example

 /**
  * Returns a followup value from a patient ticket if present.
  *
  * @param $ticket_id
  *
  * @return array|bool followup value or false if not present
  */
 public function getFollowUp($ticket_id)
 {
     if (!($ticket = Ticket::model()->findByPk((int) $ticket_id))) {
         return false;
     }
     if ($queue_assignments = $ticket->queue_assignments) {
         foreach ($queue_assignments as $queue_assignment) {
             $ticket_fields = json_decode($queue_assignment->details, true);
             if ($ticket_fields) {
                 foreach ($ticket_fields as $ticket_field) {
                     if (@$ticket_field['widget_name'] == 'TicketAssignOutcome') {
                         if (@isset($ticket_field['value']['outcome'])) {
                             if ($ticket_outcome_option = TicketAssignOutcomeOption::model()->findByPk((int) $ticket_field['value']['outcome'])) {
                                 if ($ticket_outcome_option->followup == 1) {
                                     return $ticket_field['value'];
                                 }
                             }
                         }
                     }
                 }
             }
         }
     }
     return false;
 }
All Usage Examples Of OEModule\PatientTicketing\models\TicketAssignOutcomeOption::model