OEModule\PatientTicketing\models\Queue::getRootQueue PHP 메소드

getRootQueue() 공개 메소드

Get the root queue for this particular queue (Note: this assumes that all queues are only in one path, if that model changes this will not work).
public getRootQueue ( ) : Queue[] | Queue
리턴 Queue[] | Queue
    public function getRootQueue()
    {
        if ($this->is_initial) {
            return $this;
        }
        $root = array();
        foreach (QueueOutcome::model()->findAllByAttributes(array('outcome_queue_id' => $this->id)) as $qo) {
            $q = $qo->queue->getRootQueue();
            $root = $this->mergeRootQueues($root, $q);
        }
        if (count($root) == 1) {
            return $root[0];
        }
        return $root;
    }