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

getDependentQueueIds() public method

Get the ids of queues that depend solely on this queue for tickets to be assigned to them.
public getDependentQueueIds ( array $dependent_ids = [] ) : array
$dependent_ids array
return array
    public function getDependentQueueIds($dependent_ids = array())
    {
        $dependents = array();
        foreach ($this->outcome_queues as $oc) {
            $criteria = new \CDbCriteria();
            $criteria->addNotInCondition('queue_id', array_unique(array_merge($dependent_ids, array($this->id))));
            $criteria->addColumnCondition(array('outcome_queue_id' => $oc->id));
            $ct = QueueOutcome::model()->count($criteria);
            if ($ct == 0) {
                $dependents[] = $oc;
                $dependent_ids[] = $oc->id;
            }
        }
        foreach ($dependents as $dependent) {
            $dependent_ids = array_unique(array_merge($dependent_ids, $dependent->getDependentQueueIds($dependent_ids)));
        }
        return $dependent_ids;
    }