/**
  * MonkeyDataXmlModel constructor.
  */
 public function __construct()
 {
     parent::__construct();
     $this->serverTimezone = $this->getServerTimezone();
     if (!XmlGenerator::isNotDebug()) {
         error_reporting(E_ALL);
     }
     $eshopTimezone = $this->getEshopTimezone();
     if ($eshopTimezone === null) {
         $eshopTimezone = $this->serverTimezone;
     }
     $this->eshopTimezone = $eshopTimezone;
 }
コード例 #2
0
 public function run()
 {
     if (!XmlGenerator::isNotDebug()) {
         error_reporting(E_ALL);
         echo "<pre>";
     }
     $time_start = MDHelper::microtime_float();
     $this->handleParams();
     $this->authenticate();
     $this->categoriesList = $this->getModel()->getCategoriesItems();
     if (XmlGenerator::isNotDebug()) {
         $this->showXmlHeader();
     }
     $eshopEntity = new EshopEntity();
     echo $eshopEntity->getStartTag();
     echo new VersionEntity();
     $this->generate();
     $time_end = MDHelper::microtime_float();
     $time = $time_end - $time_start;
     echo new RuntimeEntity($time . " s");
     echo new MemoryUsageEntity(memory_get_peak_usage(true) / 1024 . " kB");
     echo $eshopEntity->getEndTag();
 }
コード例 #3
0
 private function generate()
 {
     //reset XMLmodel and all his variables for each iteration run this function
     $start = $this->model->getStart();
     $this->model = $this->getXmlModel();
     $this->model->setStart($start);
     //fill data from DB to local variables
     $this->model->prepareOrders($this->date_from, $this->date_to);
     $orders = $this->model->getOrders();
     if (count($orders) == 0) {
         return;
         //end of calling this recursive function
     }
     $this->orderStatusBean = $this->model->getOrderStatuses($this->model->getOrderStatusesIds());
     $this->payment = $this->model->getPayments($this->model->getPaymentIds());
     $this->shipping = $this->model->getShippings($this->model->getShipppingIds());
     $this->customerBean = $this->model->getCustomers($this->model->getCustomerIds());
     $this->orderProductBean = $this->model->getProducts($this->model->getOrderIds());
     foreach ($orders as $order) {
         $this->showShopOrder($order);
     }
     if (count($orders) < $this->model->getStep()) {
         return;
     }
     if (XmlGenerator::isNotDebug()) {
         $this->generate();
     }
 }