public function getPayload($currentUserId = null)
    {
        $class = $this->getOption('payload');
        if(!is_a($class , TaskPayLoad::class , true)) {
            throw new BadTaskQueueOption('task payload must implement ' . TaskPayLoad::class);
        }
        /**
         * @var $payload TaskPayLoad
         */
        $payload = new $class($this->getPersistence() , $currentUserId);
        $payload->setServiceLocator($this->getServiceLocator());
        /**
         * @var TaskPayLoad $payload
         */
        return $payload;
    }
public function getPayload($currentUserId = null)
    {
        $class = $this->getOption('payload');
        if(!is_a($class , TaskPayLoad::class , true)) {
            throw new BadTaskQueueOption('task payload must implement ' . TaskPayLoad::class);
        }
        /**
         * @var $payload TaskPayLoad
         */
        $payload = new $class($this->getPersistence() , $currentUserId);
        $payload->setServiceLocator($this->getServiceLocator());
        /**
         * @var TaskPayLoad $payload
         */
        return $payload;
    }
public function getPayload ( $ currentUserId = null ) { $ class = $ this -> getOption ( 'payload' ) ; if ( ! is_a ( $ class , TaskPayLoad :: class , true ) ) { throw new BadTaskQueueOption ( 'task payload must implement ' . TaskPayLoad :: class ) ; } /**
         * @var $payload TaskPayLoad
         */ $ payload = new $ class ( $ this -> getPersistence ( ) , $ currentUserId ) ; $ payload -> setServiceLocator ( $ this -> getServiceLocator ( ) ) ; /**
         * @var TaskPayLoad $payload
         */ return $ payload ; }
return a new instance of payload

@deprecated since version 7.10.0, to be removed in 8.0.

@param $currentUserId
@return TaskPayLoad
@throws BadTaskQueueOption
return a new instance of payload