OEModule\PatientTicketing\services\PatientTicketing_QueueService::canDeleteQueue PHP Method

canDeleteQueue() public method

Check if the given Queue can be deleted (has no tickets assigned and no dependent queues with tickets).
public canDeleteQueue ( $queue_id ) : boolean
$queue_id
return boolean
    public function canDeleteQueue($queue_id)
    {
        if ($this->getCurrentTicketCount($queue_id)) {
            return false;
        }
        $queue = $this->readModel($queue_id);
        foreach ($queue->getDependentQueueIds() as $dep_id) {
            if ($this->getCurrentTicketCount($dep_id)) {
                return false;
            }
        }
        return true;
    }