public function addWorker($worker)
    {
        if (!$worker instanceof Worker) {
            throw new \Exception('$worker is not an instance of Worker');
        }
        $this->workerList[$worker->getId()] = $worker;

        return $this;
    }
public function addWorker($worker)
    {
        if (!$worker instanceof Worker) {
            throw new \Exception('$worker is not an instance of Worker');
        }
        $this->workerList[$worker->getId()] = $worker;

        return $this;
    }
public function addWorker ( $ worker ) { if ( ! $ worker instanceof Worker ) { throw new \ Exception ( '$worker is not an instance of Worker' ) ; } $ this -> workerList [ $ worker -> getId ( ) ] = $ worker ; return $ this ; }
Adds a worker to the action.

@param Worker $worker

@return Action
@throws \Exception
Adds a worker to the action .