private function getInvoices(DateTime $startDate, DateTime $endDate)
    {
        $offset = Mirakl::MIRAKL_API_MAX_PAGINATE;

        $invoicesData = $this->mirakl->getInvoices(
            $startDate,
            $endDate
        );

        $invoices = array_merge(array(), $invoicesData['invoices']);

        $total = $invoicesData['total_count'];

        while ($total % $offset !== $total) {

            $invoicesData = $this->mirakl->getInvoices(
                $startDate,
                $endDate,
                Mirakl::MIRAKL_API_MAX_PAGINATE,
                $offset
            );

            $invoices = array_merge($invoices, $invoicesData['invoices']);

            $offset += Mirakl::MIRAKL_API_MAX_PAGINATE;
        }

        return $invoices;
    }
private function getInvoices(DateTime $startDate, DateTime $endDate)
    {
        $offset = Mirakl::MIRAKL_API_MAX_PAGINATE;

        $invoicesData = $this->mirakl->getInvoices(
            $startDate,
            $endDate
        );

        $invoices = array_merge(array(), $invoicesData['invoices']);

        $total = $invoicesData['total_count'];

        while ($total % $offset !== $total) {

            $invoicesData = $this->mirakl->getInvoices(
                $startDate,
                $endDate,
                Mirakl::MIRAKL_API_MAX_PAGINATE,
                $offset
            );

            $invoices = array_merge($invoices, $invoicesData['invoices']);

            $offset += Mirakl::MIRAKL_API_MAX_PAGINATE;
        }

        return $invoices;
    }
private function getInvoices ( DateTime $ startDate , DateTime $ endDate ) { $ offset = Mirakl :: MIRAKL_API_MAX_PAGINATE ; $ invoicesData = $ this -> mirakl -> getInvoices ( $ startDate , $ endDate ) ; $ invoices = array_merge ( array ( ) , $ invoicesData [ 'invoices' ] ) ; $ total = $ invoicesData [ 'total_count' ] ; while ( $ total % $ offset !== $ total ) { $ invoicesData = $ this -> mirakl -> getInvoices ( $ startDate , $ endDate , Mirakl :: MIRAKL_API_MAX_PAGINATE , $ offset ) ; $ invoices = array_merge ( $ invoices , $ invoicesData [ 'invoices' ] ) ; $ offset += Mirakl :: MIRAKL_API_MAX_PAGINATE ; } return $ invoices ; }
Get invoices from Mirakl API

@param DateTime $startDate
@param DateTime $endDate
@return type
Get invoices from Mirakl API