src/Shop/InvoiceManager.php
public function sendMultiple(array $invoiceSources, $forceSend, $dryRun, array &$log)
    {
        $this->getTranslator()->add(new ResultTranslations());
        $errorLogged = false;
        $success = true;
        $time_limit = ini_get('max_execution_time');
        foreach ($invoiceSources as $invoiceSource) {
            // Try to keep the script running, but note that other systems
            // involved, like the (Apache) web server, may have their own
            // time-out. Use @ to prevent messages like "Warning:
            // set_time_limit(): Cannot set max execution time limit due to
            // system policy in ...".
            if (!@set_time_limit($time_limit) && !$errorLogged) {
                $this->getLog()->warning('InvoiceManager::sendMultiple(): could not set time limit.');
                $errorLogged = true;
            }

            $result = $this->getInvoiceResult('InvoiceManager::sendMultiple()');
            $result = $this->createAndSend($invoiceSource, $result, $forceSend, $dryRun);
            $success = $success && !$result->hasError();
            $this->getLog()->notice($this->getSendResultLogText($invoiceSource, $result));
            $log[$invoiceSource->getId()] = $this->getSendResultLogText($invoiceSource, $result,Result::AddReqResp_Never);
        }
        return $success;
    }
public function sendMultiple(array $invoiceSources, $forceSend, $dryRun, array &$log)
    {
        $this->getTranslator()->add(new ResultTranslations());
        $errorLogged = false;
        $success = true;
        $time_limit = ini_get('max_execution_time');
        foreach ($invoiceSources as $invoiceSource) {
            // Try to keep the script running, but note that other systems
            // involved, like the (Apache) web server, may have their own
            // time-out. Use @ to prevent messages like "Warning:
            // set_time_limit(): Cannot set max execution time limit due to
            // system policy in ...".
            if (!@set_time_limit($time_limit) && !$errorLogged) {
                $this->getLog()->warning('InvoiceManager::sendMultiple(): could not set time limit.');
                $errorLogged = true;
            }

            $result = $this->getInvoiceResult('InvoiceManager::sendMultiple()');
            $result = $this->createAndSend($invoiceSource, $result, $forceSend, $dryRun);
            $success = $success && !$result->hasError();
            $this->getLog()->notice($this->getSendResultLogText($invoiceSource, $result));
            $log[$invoiceSource->getId()] = $this->getSendResultLogText($invoiceSource, $result,Result::AddReqResp_Never);
        }
        return $success;
    }
public function sendMultiple ( array $ invoiceSources , $ forceSend , $ dryRun , array & $ log ) { $ this -> getTranslator ( ) -> add ( new ResultTranslations ( ) ) ; $ errorLogged = false ; $ success = true ; $ time_limit = ini_get ( 'max_execution_time' ) ; foreach ( $ invoiceSources as $ invoiceSource ) { // Try to keep the script running, but note that other systems // involved, like the (Apache) web server, may have their own // time-out. Use @ to prevent messages like "Warning: // set_time_limit(): Cannot set max execution time limit due to // system policy in ...". if ( ! @ set_time_limit ( $ time_limit ) && ! $ errorLogged ) { $ this -> getLog ( ) -> warning ( 'InvoiceManager::sendMultiple(): could not set time limit.' ) ; $ errorLogged = true ; } $ result = $ this -> getInvoiceResult ( 'InvoiceManager::sendMultiple()' ) ; $ result = $ this -> createAndSend ( $ invoiceSource , $ result , $ forceSend , $ dryRun ) ; $ success = $ success && ! $ result -> hasError ( ) ; $ this -> getLog ( ) -> notice ( $ this -> getSendResultLogText ( $ invoiceSource , $ result ) ) ; $ log [ $ invoiceSource -> getId ( ) ] = $ this -> getSendResultLogText ( $ invoiceSource , $ result , Result :: AddReqResp_Never ) ; } return $ success ; }
Sends multiple invoices to Acumulus.

@param \Siel\Acumulus\Invoice\Source[] $invoiceSources
@param bool $forceSend
If true, force sending the invoices even if an invoice has already been
sent for a given invoice source.
@param bool $dryRun
If true, return the reason/status only but do not actually send the
invoice, nor mail the result or store the result.
@param string[] $log

@return bool
Success.
Sends multiple invoices to Acumulus .