private function getOkOrdersStatuses($limit = 50) { $okOrdersStatusesDataProvider = new OkOrdersStatusDataProvider($this->db, $this->okChannel->getCustomersId()); $okOrdersStatusesArray = $okOrdersStatusesDataProvider->getAll(); array_splice($okOrdersStatusesArray, $limit); return $okOrdersStatusesArray; }
protected function setUp() { $this->db = TestsHelpers::getDb(); $this->db->setVerboseMode(); $this->iniParams = TestsHelpers::getIniParams(); $this->bfVersion = $this->iniParams->get("bfVersion"); $this->okChannel = new OkChannel($this->iniParams->get("channelId"), $this->db); $this->logger = LoggerFactory::getFileLogger(TestsHelpers::getUserLog(), Logger::WARNING); TestsHelpers::cleanAllLogs(); $okOrdersStatusesDataProvider = new OkOrdersStatusDataProvider($this->db, $this->okChannel->getCustomersId()); $this->okOrdersStatusesArray = $okOrdersStatusesDataProvider->getAll(); $this->xmlExporter = new OrdersStatuses($this->iniParams, $this->okOrdersStatusesArray, $this->logger); $this->fileName = __DIR__ . "/Data/Exports/OrdersStatuses.xml"; if (file_exists($this->fileName)) { unlink($this->fileName); } // we have to set the shipping date so the feed returns results $sql = "UPDATE shipping_orders SET shipping_date = NOW()"; $this->db->execute($sql, array()); }
public function getAllSingleLinePerOrder($okOrdersStatusesArray) { return parent::getAllSingleLinePerOrder($okOrdersStatusesArray); }
private function buildOrdersStatusesConnector() { $this->db = $this->getDbReadOnly(); $this->okChannel = new OkChannel($this->iniParams->get("channelId"), $this->db); $localFeedPath = sprintf("%s/%s.xml", $this->getConnectorFilesDir(), $this->connectorRunId); $userLogger = $this->getUserLogger(); $okOrdersStatusesDataProvider = new OkOrdersStatusDataProvider($this->db, $this->okChannel->getCustomersId()); $xmlExporter = new OrdersStatuses($this->iniParams, $okOrdersStatusesDataProvider->getAll(), $userLogger); return new XmlToLocalConnector($localFeedPath, $xmlExporter, $userLogger); }