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

mergeRootQueues() private method

Helper method for handling the construction of the root node set.
private mergeRootQueues ( $root, $candidates ) : array
$root
$candidates
return array
    private function mergeRootQueues($root, $candidates)
    {
        if (!is_array($candidates)) {
            $candidates = array($candidates);
        }
        foreach ($candidates as $c) {
            $seen = false;
            foreach ($root as $r) {
                if ($r->id == $c->id) {
                    $seen = true;
                    break;
                }
            }
            if (!$seen) {
                $root[] = $c;
            }
        }
        return $root;
    }