Пример #1
0
 protected function logAdmin($message, array $context = array(), $severity)
 {
     if (!is_array($message)) {
         $message = explode('--', $message);
     }
     if (is_array($message) && count($message) > 2) {
         $newLog = $this->logFactory->create();
         $newLog->parse($severity, $message[0], $message[1], $message[2]);
     }
 }
Пример #2
0
 protected function saveSynchData($data)
 {
     $result = 0;
     try {
         $this->synchronizeFactory->create()->deleteAllSynchData();
     } catch (\Exception $e) {
         $result = false;
         $this->shipperLogger->postDebug('Shipperhq_Shipper', 'Unable to remove existing attribute update data', $e->getMessage());
     }
     if (empty($data)) {
         $this->shipperLogger->postDebug('Shipperhq_Shipper', 'Saving synch data', 'No attribute changes required, 0 rows saved');
         return $result;
     }
     foreach ($data as $update) {
         $newUpdate = $this->synchronizeFactory->create();
         $newUpdate->setData($update);
         $newUpdate->save();
         $result++;
     }
     return $result;
 }