/** * @return bool * @throws \Ess\M2ePro\Model\Exception\Logic */ public function isLocked() { if (parent::isLocked()) { return true; } return (bool) $this->activeRecordFactory->getObject('Amazon\\Listing')->getCollection()->addFieldToFilter('template_selling_format_id', $this->getId())->getSize(); }
/** * @return bool * @throws \Ess\M2ePro\Model\Exception\Logic */ public function isLocked() { if (parent::isLocked()) { return true; } $collection = $this->activeRecordFactory->getObject('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) $this->activeRecordFactory->getObject('Amazon\\Listing\\Product')->getCollection()->addFieldToFilter('template_description_id', $this->getId())->getSize() || (bool) $this->activeRecordFactory->getObject('Amazon\\Listing\\Auto\\Category\\Group')->getCollection()->addFieldToFilter('adding_description_template_id', $this->getId())->getSize() || (bool) $collection->getSize(); }
/** * @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; }