public function reportExecution(DeliveryExecution $deliveryExecution, $reason)
    {
        $deliveryLog = $this->getDeliveryLogService();
        $data = [
            'reason' => $reason,
            'timestamp' => microtime(true),
            'itemId' => $this->getCurrentItemId($deliveryExecution),
            'context' => $this->getContext($deliveryExecution)
        ];
        $returnValue = $deliveryLog->log($deliveryExecution->getIdentifier(), 'TEST_IRREGULARITY', $data);

        // Trigger a report event.
        /** @var EventManager $eventManager */
        $eventManager = $this->getServiceManager()->get(EventManager::SERVICE_ID);
        $eventManager->trigger(new DeliveryExecutionIrregularityReport($deliveryExecution));

        return $returnValue;
    }
public function reportExecution(DeliveryExecution $deliveryExecution, $reason)
    {
        $deliveryLog = $this->getDeliveryLogService();
        $data = [
            'reason' => $reason,
            'timestamp' => microtime(true),
            'itemId' => $this->getCurrentItemId($deliveryExecution),
            'context' => $this->getContext($deliveryExecution)
        ];
        $returnValue = $deliveryLog->log($deliveryExecution->getIdentifier(), 'TEST_IRREGULARITY', $data);

        // Trigger a report event.
        /** @var EventManager $eventManager */
        $eventManager = $this->getServiceManager()->get(EventManager::SERVICE_ID);
        $eventManager->trigger(new DeliveryExecutionIrregularityReport($deliveryExecution));

        return $returnValue;
    }
public function reportExecution ( DeliveryExecution $ deliveryExecution , $ reason ) { $ deliveryLog = $ this -> getDeliveryLogService ( ) ; $ data = [ 'reason' => $ reason , 'timestamp' => microtime ( true ) , 'itemId' => $ this -> getCurrentItemId ( $ deliveryExecution ) , 'context' => $ this -> getContext ( $ deliveryExecution ) ] ; $ returnValue = $ deliveryLog -> log ( $ deliveryExecution -> getIdentifier ( ) , 'TEST_IRREGULARITY' , $ data ) ; // Trigger a report event. /** @var EventManager $eventManager */ $ eventManager = $ this -> getServiceManager ( ) -> get ( EventManager :: SERVICE_ID ) ; $ eventManager -> trigger ( new DeliveryExecutionIrregularityReport ( $ deliveryExecution ) ) ; return $ returnValue ; }
Report irregularity to a delivery execution

@todo remove this method to separate service
@param DeliveryExecution $deliveryExecution
@param array $reason
@return bool
Report irregularity to a delivery execution