public function process(DateTime $startDate, DateTime $endDate, DateTime $cycleDate)
    {
        $this->logger->info('Control Mirakl Settings', array('miraklId' => null, "action" => "Operations creation"));
        // control mirakl settings
        $boolControl = $this->getControlMiraklSettings($this->documentTypes);
        if ($boolControl === false) {
            // log critical
            $title = $this->criticalMessageMiraklSettings;
            $message = $this->formatNotification->formatMessage($title);
            $this->logger->critical($message, array('miraklId' => null, "action" => "Operations creation"));
        } else {
            $this->logger->info(
                'Control Mirakl Settings OK',
                array('miraklId' => null, "action" => "Operations creation")
            );
        }

        $this->logger->info('Cashout Initializer', array('miraklId' => null, "action" => "Operations creation"));

        //Fetch Invoices
        $this->logger->info(
            'Fetch invoices documents from Mirakl from ' .
            $startDate->format('Y-m-d H:i') .
            ' to ' .
            $endDate->format('Y-m-d H:i')
            ,
            array('miraklId' => null, "action" => "Operations creation")
        );

        // get invoices from Mirakl API
        $invoices = $this->getInvoices($startDate, $endDate);

        $this->logger->info(
            '[OK] Fetched ' . count($invoices) . ' invoices',
            array('miraklId' => null, "action" => "Operations creation")
        );

        $this->logger->info('Process invoices', array('miraklId' => null, "action" => "Operations creation"));

        $operations = $this->processInvoices($invoices, $cycleDate);

        $this->saveOperations($operations);

    }
public function process(DateTime $startDate, DateTime $endDate, DateTime $cycleDate)
    {
        $this->logger->info('Control Mirakl Settings', array('miraklId' => null, "action" => "Operations creation"));
        // control mirakl settings
        $boolControl = $this->getControlMiraklSettings($this->documentTypes);
        if ($boolControl === false) {
            // log critical
            $title = $this->criticalMessageMiraklSettings;
            $message = $this->formatNotification->formatMessage($title);
            $this->logger->critical($message, array('miraklId' => null, "action" => "Operations creation"));
        } else {
            $this->logger->info(
                'Control Mirakl Settings OK',
                array('miraklId' => null, "action" => "Operations creation")
            );
        }

        $this->logger->info('Cashout Initializer', array('miraklId' => null, "action" => "Operations creation"));

        //Fetch Invoices
        $this->logger->info(
            'Fetch invoices documents from Mirakl from ' .
            $startDate->format('Y-m-d H:i') .
            ' to ' .
            $endDate->format('Y-m-d H:i')
            ,
            array('miraklId' => null, "action" => "Operations creation")
        );

        // get invoices from Mirakl API
        $invoices = $this->getInvoices($startDate, $endDate);

        $this->logger->info(
            '[OK] Fetched ' . count($invoices) . ' invoices',
            array('miraklId' => null, "action" => "Operations creation")
        );

        $this->logger->info('Process invoices', array('miraklId' => null, "action" => "Operations creation"));

        $operations = $this->processInvoices($invoices, $cycleDate);

        $this->saveOperations($operations);

    }
public function process ( DateTime $ startDate , DateTime $ endDate , DateTime $ cycleDate ) { $ this -> logger -> info ( 'Control Mirakl Settings' , array ( 'miraklId' => null , "action" => "Operations creation" ) ) ; // control mirakl settings $ boolControl = $ this -> getControlMiraklSettings ( $ this -> documentTypes ) ; if ( $ boolControl === false ) { // log critical $ title = $ this -> criticalMessageMiraklSettings ; $ message = $ this -> formatNotification -> formatMessage ( $ title ) ; $ this -> logger -> critical ( $ message , array ( 'miraklId' => null , "action" => "Operations creation" ) ) ; } else { $ this -> logger -> info ( 'Control Mirakl Settings OK' , array ( 'miraklId' => null , "action" => "Operations creation" ) ) ; } $ this -> logger -> info ( 'Cashout Initializer' , array ( 'miraklId' => null , "action" => "Operations creation" ) ) ; //Fetch Invoices $ this -> logger -> info ( 'Fetch invoices documents from Mirakl from ' . $ startDate -> format ( 'Y-m-d H:i' ) . ' to ' . $ endDate -> format ( 'Y-m-d H:i' ) , array ( 'miraklId' => null , "action" => "Operations creation" ) ) ; // get invoices from Mirakl API $ invoices = $ this -> getInvoices ( $ startDate , $ endDate ) ; $ this -> logger -> info ( '[OK] Fetched ' . count ( $ invoices ) . ' invoices' , array ( 'miraklId' => null , "action" => "Operations creation" ) ) ; $ this -> logger -> info ( 'Process invoices' , array ( 'miraklId' => null , "action" => "Operations creation" ) ) ; $ operations = $ this -> processInvoices ( $ invoices , $ cycleDate ) ; $ this -> saveOperations ( $ operations ) ; }
Main processing function
Generate and save operations.

@param DateTime $startDate
@param DateTime $endDate
@param DateTime $cycleDate

@throws Exception

@codeCoverageIgnore
Main processing function Generate and save operations .