public function addWaitingWorker($id)
    {
        if ($id instanceof Worker) {
            $id = $id->getId();
        }

        if (!isset($this->workerList[$id])) {
            throw new \Exception('Trying to add non existent worker to the queue.');
        }
        $worker = $this->workerList[$id];

        $this->ready = true;

        /*
         * Only add the worker to the end of the wait list if it is not
         * already there.
         */
        if (!isset($this->waitingList[$id])) {
            $this->waitingList[$id] = $worker;
        }

        return $this;
    }
public function addWaitingWorker($id)
    {
        if ($id instanceof Worker) {
            $id = $id->getId();
        }

        if (!isset($this->workerList[$id])) {
            throw new \Exception('Trying to add non existent worker to the queue.');
        }
        $worker = $this->workerList[$id];

        $this->ready = true;

        /*
         * Only add the worker to the end of the wait list if it is not
         * already there.
         */
        if (!isset($this->waitingList[$id])) {
            $this->waitingList[$id] = $worker;
        }

        return $this;
    }
public function addWaitingWorker ( $ id ) { if ( $ id instanceof Worker ) { $ id = $ id -> getId ( ) ; } if ( ! isset ( $ this -> workerList [ $ id ] ) ) { throw new \ Exception ( 'Trying to add non existent worker to the queue.' ) ; } $ worker = $ this -> workerList [ $ id ] ; $ this -> ready = true ; /*
         * Only add the worker to the end of the wait list if it is not
         * already there.
         */ if ( ! isset ( $ this -> waitingList [ $ id ] ) ) { $ this -> waitingList [ $ id ] = $ worker ; } return $ this ; }
Adds the worker to the waiting list if it is not already in there.

@param string|Worker $id

@return Action
@throws \Exception
Adds the worker to the waiting list if it is not already in there .