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

model() public static method

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

Usage Example

Example #1
0
 public function run()
 {
     $cls_name = explode('\\', get_class($this));
     $this->shortName = array_pop($cls_name);
     if (file_exists(dirname(__FILE__) . '/js/' . $this->shortName . '.js')) {
         $this->assetFolder = Yii::app()->getAssetManager()->publish(dirname(__FILE__) . '/js/');
         Yii::app()->getClientScript()->registerScriptFile($this->assetFolder . '/' . $this->shortName . '.js');
     }
     if ($this->queue_id) {
         $queue = models\Queue::model()->findByPk($this->queue_id);
     } else {
         $queue = null;
     }
     $form_fields = $queue->getFormFields();
     $auto_save = false;
     if (isset($_POST[$form_fields[0]['form_name']])) {
         // if post contains patient ticket data
         $form_data = $_POST;
     } elseif ($form_data = AutoSaveTicket::getFormData($this->patient_id, $this->current_queue_id)) {
         $auto_save = true;
     }
     //if this is the outcome widget and a correspondence has been created
     //display the print letter button
     $print_letter_event = false;
     foreach ($form_fields as $fld) {
         if (@$fld['widget_name'] == 'TicketAssignAppointment') {
             if ($api = \Yii::app()->moduleAPI->get('OphCoCorrespondence')) {
                 if ($episode = $this->ticket->patient->getEpisodeForCurrentSubspecialty()) {
                     if ($event = $api->getLatestEvent($episode)) {
                         if ($event->created_date > $this->ticket->created_date) {
                             $print_letter_event = $event;
                         }
                     }
                 }
             }
         }
     }
     $this->render('QueueAssign', array('queue' => $queue, 'form_fields' => $form_fields, 'form_data' => $form_data, 'auto_save' => $auto_save, 'print_letter_event' => $print_letter_event));
 }
All Usage Examples Of OEModule\PatientTicketing\models\Queue::model