protected function getTask($taskId)
    {
        if (!isset($this->tasks[$taskId])) {
            /** @var Queue $taskQueue */
            $taskQueue = $this->getServiceManager()->get(Queue::SERVICE_ID);
            $task = $taskQueue->getTask($taskId);
            if ($task === null) {
                throw new \common_exception_NotFound(__('Task not found'));
            }
            $this->tasks[$taskId] = $task;
        }
        return $this->tasks[$taskId];
    }
protected function getTask($taskId)
    {
        if (!isset($this->tasks[$taskId])) {
            /** @var Queue $taskQueue */
            $taskQueue = $this->getServiceManager()->get(Queue::SERVICE_ID);
            $task = $taskQueue->getTask($taskId);
            if ($task === null) {
                throw new \common_exception_NotFound(__('Task not found'));
            }
            $this->tasks[$taskId] = $task;
        }
        return $this->tasks[$taskId];
    }
protected function getTask ( $ taskId ) { if ( ! isset ( $ this -> tasks [ $ taskId ] ) ) { /** @var Queue $taskQueue */ $ taskQueue = $ this -> getServiceManager ( ) -> get ( Queue :: SERVICE_ID ) ; $ task = $ taskQueue -> getTask ( $ taskId ) ; if ( $ task === null ) { throw new \ common_exception_NotFound ( __ ( 'Task not found' ) ) ; } $ this -> tasks [ $ taskId ] = $ task ; } return $ this -> tasks [ $ taskId ] ; }
Get task instance from queue by identifier
@param $taskId task identifier
@throws \common_exception_NotFound
@return Task
Get task instance from queue by identifier