Esempio n. 1
0
 protected function getProcessingRunner()
 {
     if (!is_null($this->processingRunner)) {
         return $this->processingRunner;
     }
     $this->processingRunner = $this->modelFactory->getObject($this->getProcessingRunnerModelName());
     $this->processingRunner->setParams($this->getProcessingParams());
     $this->processingRunner->setResponserModelName($this->getResponserModelName());
     $this->processingRunner->setResponserParams($this->getResponserParams());
     return $this->processingRunner;
 }
Esempio n. 2
0
 protected function unsetLocks()
 {
     parent::unsetLocks();
     $params = $this->getParams();
     $alreadyUnlockedListings = array();
     $alreadyUnlockedParents = array();
     foreach ($this->getListingsProducts() as $listingProduct) {
         $listingProduct->deleteProcessingLocks(NULL, $this->getProcessingObject()->getId());
         $listingProduct->deleteProcessingLocks('in_action', $this->getProcessingObject()->getId());
         $listingProduct->deleteProcessingLocks($params['lock_identifier'] . '_action', $this->getProcessingObject()->getId());
         /** @var \Ess\M2ePro\Model\Amazon\Listing\Product $amazonListingProduct */
         $amazonListingProduct = $listingProduct->getChildObject();
         $variationManager = $amazonListingProduct->getVariationManager();
         if ($variationManager->isRelationChildType()) {
             $parentListingProduct = $variationManager->getTypeModel()->getParentListingProduct();
             if (isset($alreadyUnlockedParents[$parentListingProduct->getId()])) {
                 continue;
             }
             $parentListingProduct->deleteProcessingLocks(NULL, $this->getProcessingObject()->getId());
             $parentListingProduct->deleteProcessingLocks('child_products_in_action', $this->getProcessingObject()->getId());
             $alreadyUnlockedParents[$parentListingProduct->getId()] = true;
         }
         if (isset($alreadyUnlockedListings[$listingProduct->getListingId()])) {
             continue;
         }
         $listingProduct->getListing()->deleteProcessingLocks(NULL, $this->getProcessingObject()->getId());
         $alreadyUnlockedListings[$listingProduct->getListingId()] = true;
     }
 }
Esempio n. 3
0
 protected function unsetLocks()
 {
     parent::unsetLocks();
     $params = $this->getParams();
     $this->getListingProduct()->deleteProcessingLocks(NULL, $this->getProcessingObject()->getId());
     $this->getListingProduct()->deleteProcessingLocks('in_action', $this->getProcessingObject()->getId());
     $this->getListingProduct()->deleteProcessingLocks($params['lock_identifier'] . '_action', $this->getProcessingObject()->getId());
     $this->getListingProduct()->getListing()->deleteProcessingLocks(NULL, $this->getProcessingObject()->getId());
 }
Esempio n. 4
0
 protected function unsetLocks()
 {
     parent::unsetLocks();
     $params = $this->getParams();
     /** @var \Ess\M2ePro\Model\Account $account */
     $account = $this->parentFactory->getCachedObjectLoaded(\Ess\M2ePro\Helper\Component\Amazon::NICK, 'Account', $params['account_id']);
     $account->deleteProcessingLocks(NULL, $this->getProcessingObject()->getId());
     $account->deleteProcessingLocks('server_synchronize', $this->getProcessingObject()->getId());
     $account->deleteProcessingLocks('adding_to_server', $this->getProcessingObject()->getId());
 }
Esempio n. 5
0
 protected function unsetLocks()
 {
     parent::unsetLocks();
     $params = $this->getParams();
     /** @var \Ess\M2ePro\Model\Order $orders */
     $orders = $this->activeRecordFactory->getObject('Order')->getCollection()->addFieldToFilter('id', array('in' => $params['orders_ids']))->getItems();
     foreach ($orders as $order) {
         $order->deleteProcessingLocks('refund_order', $this->getProcessingObject()->getId());
     }
 }
Esempio n. 6
0
 protected function unsetLocks()
 {
     parent::unsetLocks();
     $params = $this->getParams();
     /** @var $lockItem \Ess\M2ePro\Model\LockItem */
     $lockItem = $this->activeRecordFactory->getObject('LockItem');
     $lockItem->setNick(self::LOCK_ITEM_PREFIX . '_' . $params['account_id']);
     $lockItem->remove();
     /** @var \Ess\M2ePro\Model\Account $account */
     $account = $this->parentFactory->getCachedObjectLoaded(\Ess\M2ePro\Helper\Component\Amazon::NICK, 'Account', $params['account_id']);
     $account->deleteProcessingLocks(NULL, $this->getProcessingObject()->getId());
     $account->deleteProcessingLocks('synchronization', $this->getProcessingObject()->getId());
     $account->deleteProcessingLocks('synchronization_amazon', $this->getProcessingObject()->getId());
     $account->deleteProcessingLocks(self::LOCK_ITEM_PREFIX, $this->getProcessingObject()->getId());
 }
Esempio n. 7
0
 protected function unsetLocks()
 {
     parent::unsetLocks();
     $alreadyUnlockedListings = array();
     foreach ($this->getListingsProducts() as $listingProduct) {
         /** @var $listingProduct \Ess\M2ePro\Model\Listing\Product */
         $listingProduct->deleteProcessingLocks(NULL, $this->getProcessingObject()->getId());
         $listingProduct->deleteProcessingLocks('in_action', $this->getProcessingObject()->getId());
         $listingProduct->deleteProcessingLocks('translation_action', $this->getProcessingObject()->getId());
         if (isset($alreadyUnlockedListings[$listingProduct->getListingId()])) {
             continue;
         }
         $listingProduct->getListing()->deleteProcessingLocks(NULL, $this->getProcessingObject()->getId());
         $alreadyUnlockedListings[$listingProduct->getListingId()] = true;
     }
 }
Esempio n. 8
0
 protected function unsetLocks()
 {
     parent::unsetLocks();
     $params = $this->getParams();
     $alreadyUnlockedListings = array();
     foreach ($this->getListingsProducts() as $listingProduct) {
         $listingProduct->deleteProcessingLocks(NULL, $this->getProcessingObject()->getId());
         $listingProduct->deleteProcessingLocks('in_action', $this->getProcessingObject()->getId());
         $listingProduct->deleteProcessingLocks($params['lock_identifier'] . '_action', $this->getProcessingObject()->getId());
         if (isset($alreadyUnlockedListings[$listingProduct->getListingId()])) {
             continue;
         }
         $listingProduct->getListing()->deleteProcessingLocks(NULL, $this->getProcessingObject()->getId());
         $alreadyUnlockedListings[$listingProduct->getListingId()] = true;
     }
 }
Esempio n. 9
0
 protected function unsetLocks()
 {
     parent::unsetLocks();
     $params = $this->getParams();
     if (!isset($params['items']) || !is_array($params['items'])) {
         return;
     }
     $ordersIds = array();
     foreach ($params['items'] as $update) {
         if (!isset($update['order_id'])) {
             throw new \Ess\M2ePro\Model\Exception\Logic('Order ID is not defined.');
         }
         $ordersIds[] = (int) $update['order_id'];
     }
     /** @var \Ess\M2ePro\Model\Order $orders */
     $orders = $this->activeRecordFactory->getObject('Order')->getCollection()->addFieldToFilter('id', array('in' => $ordersIds))->getItems();
     foreach ($orders as $order) {
         $order->deleteProcessingLocks('update_shipping_status', $this->getProcessingObject()->getId());
     }
 }
Esempio n. 10
0
 protected function unsetLocks()
 {
     parent::unsetLocks();
     $this->getListingProduct()->deleteProcessingLocks(NULL, $this->getId());
     $this->getListingProduct()->getListing()->deleteProcessingLocks(NULL, $this->getId());
 }
Esempio n. 11
0
 protected function eventAfter()
 {
     parent::eventAfter();
     $params = $this->getParams();
     $this->activeRecordFactory->getObject('Ebay\\Account\\PickupStore\\State')->getResource()->unmarkAsInProcessing($params['pickup_store_state_ids']);
 }