Ejemplo n.º 1
0
 public function setLocks($hash)
 {
     $this->listingProduct->addObjectLock(NULL, $hash);
     $this->listingProduct->addObjectLock('in_action', $hash);
     $this->listingProduct->addObjectLock('search_action', $hash);
     $this->listingProduct->getListing()->addObjectLock(NULL, $hash);
     $this->listingProduct->getListing()->addObjectLock('products_in_action', $hash);
     $this->listingProduct->getListing()->addObjectLock('products_search_action', $hash);
     $this->account->addObjectLock('products_in_action', $hash);
     $this->account->addObjectLock('products_search_action', $hash);
     $this->marketplace->addObjectLock('products_in_action', $hash);
     $this->marketplace->addObjectLock('products_search_action', $hash);
     $processingStatus = Ess_M2ePro_Model_Amazon_Listing_Product::GENERAL_ID_SEARCH_STATUS_PROCESSING;
     $this->listingProduct->getChildObject()->setData('general_id_search_status', $processingStatus)->save();
 }
Ejemplo n.º 2
0
 public function setLocks($hash)
 {
     /** @var $lockItem Ess_M2ePro_Model_LockItem */
     $lockItem = Mage::getModel('M2ePro/LockItem');
     $tempNick = Ess_M2ePro_Model_Buy_Synchronization_Tasks_Defaults_UpdateListingsProducts::LOCK_ITEM_PREFIX;
     $tempNick .= '_' . $this->account->getId() . '_' . $this->marketplace->getId();
     $lockItem->setNick($tempNick);
     $lockItem->create();
     $this->account->addObjectLock(NULL, $hash);
     $this->account->addObjectLock('synchronization', $hash);
     $this->account->addObjectLock('synchronization_buy', $hash);
     $this->account->addObjectLock(Ess_M2ePro_Model_Buy_Synchronization_Tasks_Defaults_UpdateListingsProducts::LOCK_ITEM_PREFIX, $hash);
     $this->marketplace->addObjectLock(NULL, $hash);
     $this->marketplace->addObjectLock('synchronization', $hash);
     $this->marketplace->addObjectLock('synchronization_buy', $hash);
     $this->marketplace->addObjectLock(Ess_M2ePro_Model_Buy_Synchronization_Tasks_Defaults_UpdateListingsProducts::LOCK_ITEM_PREFIX, $hash);
 }
Ejemplo n.º 3
0
 public function setLocks($hash)
 {
     /** @var $lockItem Ess_M2ePro_Model_LockItem */
     $lockItem = Mage::getModel('M2ePro/LockItem');
     $lockItemPrefix = Ess_M2ePro_Model_Play_Synchronization_Tasks_Orders_Receive::LOCK_ITEM_PREFIX;
     $nick = $lockItemPrefix . '_' . $this->account->getId() . '_' . $this->marketplace->getId();
     $lockItem->setNick($nick);
     $lockItem->create();
     $this->account->addObjectLock(NULL, $hash);
     $this->account->addObjectLock('synchronization', $hash);
     $this->account->addObjectLock('synchronization_play', $hash);
     $this->account->addObjectLock($lockItemPrefix, $hash);
     $this->marketplace->addObjectLock(NULL, $hash);
     $this->marketplace->addObjectLock('synchronization', $hash);
     $this->marketplace->addObjectLock('synchronization_play', $hash);
     $this->marketplace->addObjectLock($lockItemPrefix, $hash);
 }
Ejemplo n.º 4
0
 public function setLocks($hash)
 {
     /** @var $lockItem Ess_M2ePro_Model_LockItem */
     $lockItem = Mage::getModel('M2ePro/LockItem');
     $tempNick = Ess_M2ePro_Model_Play_Synchronization_Tasks_Defaults_UpdateListingsProducts::LOCK_ITEM_PREFIX;
     $tempNick .= '_' . $this->account->getId() . '_' . $this->marketplace->getId();
     $lockItem->setNick($tempNick);
     $lockItem->create();
     $this->account->addObjectLock(NULL, $hash);
     $this->account->addObjectLock('synchronization', $hash);
     $this->account->addObjectLock('synchronization_play', $hash);
     $this->account->addObjectLock(Ess_M2ePro_Model_Play_Synchronization_Tasks_Defaults_UpdateListingsProducts::LOCK_ITEM_PREFIX, $hash);
     $this->marketplace->addObjectLock(NULL, $hash);
     $this->marketplace->addObjectLock('synchronization', $hash);
     $this->marketplace->addObjectLock('synchronization_play', $hash);
     $this->marketplace->addObjectLock(Ess_M2ePro_Model_Play_Synchronization_Tasks_Defaults_UpdateListingsProducts::LOCK_ITEM_PREFIX, $hash);
     /** @var $connWrite Varien_Db_Adapter_Pdo_Mysql */
     $connWrite = Mage::getSingleton('core/resource')->getConnection('core_write');
     $tempTable = Mage::getSingleton('core/resource')->getTableName('m2epro_play_processed_inventory');
     $connWrite->delete($tempTable, array('`hash` = ?' => (string) $hash));
 }
Ejemplo n.º 5
0
 public function setLocks($hash)
 {
     $tempListings = array();
     foreach ($this->listingsProducts as $listingProduct) {
         /** @var $listingProduct Ess_M2ePro_Model_Listing_Product */
         $listingProduct->addObjectLock(NULL, $hash);
         $listingProduct->addObjectLock('in_action', $hash);
         $listingProduct->addObjectLock('search_action', $hash);
         $processingStatus = Ess_M2ePro_Model_Amazon_Listing_Product::GENERAL_ID_SEARCH_STATUS_PROCESSING;
         $listingProduct->getChildObject()->setData('general_id_search_status', $processingStatus)->save();
         if (isset($tempListings[$listingProduct->getListingId()])) {
             continue;
         }
         $listingProduct->getListing()->addObjectLock(NULL, $hash);
         $listingProduct->getListing()->addObjectLock('products_in_action', $hash);
         $listingProduct->getListing()->addObjectLock('products_search_action', $hash);
         $tempListings[$listingProduct->getListingId()] = true;
     }
     $this->account->addObjectLock('products_in_action', $hash);
     $this->account->addObjectLock('products_search_action', $hash);
     $this->marketplace->addObjectLock('products_in_action', $hash);
     $this->marketplace->addObjectLock('products_search_action', $hash);
 }
Ejemplo n.º 6
0
 protected function setLocks($hash)
 {
     $tempListings = array();
     foreach ($this->listingsProducts as $listingProduct) {
         /** @var $listingProduct Ess_M2ePro_Model_Listing_Product */
         $listingProduct->addObjectLock(NULL, $hash);
         $listingProduct->addObjectLock('in_action', $hash);
         $listingProduct->addObjectLock('translation_action', $hash);
         if (isset($tempListings[$listingProduct->getListingId()])) {
             continue;
         }
         $listingProduct->getListing()->addObjectLock(NULL, $hash);
         $listingProduct->getListing()->addObjectLock('products_in_action', $hash);
         $listingProduct->getListing()->addObjectLock('products_translation_action', $hash);
         $tempListings[$listingProduct->getListingId()] = true;
     }
     $this->account->addObjectLock('products_in_action', $hash);
     $this->account->addObjectLock('products_translation_action', $hash);
     $this->marketplace->addObjectLock('products_in_action', $hash);
     $this->marketplace->addObjectLock('products_translation_action', $hash);
 }