public function isLocked() { if (parent::isLocked()) { return true; } return (bool) Mage::getModel('M2ePro/Amazon_Listing')->getCollection()->addFieldToFilter('template_selling_format_id', $this->getId())->getSize(); }
public function isLocked() { if (parent::isLocked()) { return true; } $collection = Mage::getModel('M2ePro/Amazon_Listing')->getCollection(); $collection->getSelect()->where("main_table.auto_global_adding_description_template_id = {$this->getId()} OR\n main_table.auto_website_adding_description_template_id = {$this->getId()}"); return (bool) Mage::getModel('M2ePro/Amazon_Listing_Product')->getCollection()->addFieldToFilter('template_description_id', $this->getId())->getSize() || (bool) Mage::getModel('M2ePro/Amazon_Listing_Auto_Category_Group')->getCollection()->addFieldToFilter('adding_description_template_id', $this->getId())->getSize() || (bool) $collection->getSize(); }
public function isLocked() { if (parent::isLocked()) { return true; } if (Mage::getModel('M2ePro/Amazon_Account')->getCollection()->addFieldToFilter('marketplace_id', $this->getId())->getSize() > 0) { return true; } return false; }
public function isLocked() { if (parent::isLocked()) { return true; } $accounts = Mage::getModel('M2ePro/Amazon_Account')->getCollection()->getItems(); foreach ($accounts as $account) { /** @var $account Ess_M2ePro_Model_Amazon_Account */ if ($account->isExistMarketplaceItem($this->getId())) { return true; } } return false; }
/** * @return bool * @throws Ess_M2ePro_Model_Exception * @throws Ess_M2ePro_Model_Exception_Logic */ public function isLocked() { if (parent::isLocked()) { return true; } if ($this->getVariationManager()->isRelationParentType()) { foreach ($this->getVariationManager()->getTypeModel()->getChildListingsProducts() as $child) { /** @var $child Ess_M2ePro_Model_Listing_Product */ if ($child->getStatus() == Ess_M2ePro_Model_Listing_Product::STATUS_LISTED) { return true; } } } return false; }