public static function createTask(\core_kernel_classes_Resource $test, \core_kernel_classes_Class $deliveryClass, array $initialProperties = [])
    {
        $action = new self();
        /** @var QueueDispatcher $queueDispatcher */
        $queueDispatcher = ServiceManager::getServiceManager()->get(QueueDispatcher::SERVICE_ID);

        $parameters = [
            'test' => $test->getUri(),
            'initialProperties' => $initialProperties
        ];

        if (!is_null($deliveryClass)) {
            $parameters['deliveryClass'] = $deliveryClass->getUri();
        }

        return $queueDispatcher->createTask($action, $parameters, __('Publishing of "%s"', $test->getLabel()), null, true);
    }
public static function createTask(\core_kernel_classes_Resource $test, \core_kernel_classes_Class $deliveryClass, array $initialProperties = [])
    {
        $action = new self();
        /** @var QueueDispatcher $queueDispatcher */
        $queueDispatcher = ServiceManager::getServiceManager()->get(QueueDispatcher::SERVICE_ID);

        $parameters = [
            'test' => $test->getUri(),
            'initialProperties' => $initialProperties
        ];

        if (!is_null($deliveryClass)) {
            $parameters['deliveryClass'] = $deliveryClass->getUri();
        }

        return $queueDispatcher->createTask($action, $parameters, __('Publishing of "%s"', $test->getLabel()), null, true);
    }
public static function createTask ( \ core_kernel_classes_Resource $ test , \ core_kernel_classes_Class $ deliveryClass , array $ initialProperties = [ ] ) { $ action = new self ( ) ; /** @var QueueDispatcher $queueDispatcher */ $ queueDispatcher = ServiceManager :: getServiceManager ( ) -> get ( QueueDispatcher :: SERVICE_ID ) ; $ parameters = [ 'test' => $ test -> getUri ( ) , 'initialProperties' => $ initialProperties ] ; if ( ! is_null ( $ deliveryClass ) ) { $ parameters [ 'deliveryClass' ] = $ deliveryClass -> getUri ( ) ; } return $ queueDispatcher -> createTask ( $ action , $ parameters , __ ( 'Publishing of "%s"' , $ test -> getLabel ( ) ) , null , true ) ; }
Create a task to compile a delivery into a delivery class

@param \core_kernel_classes_Resource $test          Test resource to be compiled
@param \core_kernel_classes_Class    $deliveryClass Delivery class where the test is compiled to
@param array                         $initialProperties
@return TaskInterface
Create a task to compile a delivery into a delivery class