/** * @param Ess_M2ePro_Model_Listing_Product $listingProduct * @return bool * @throws Ess_M2ePro_Model_Exception_Logic */ public function isMeetReviseSynchReasonsRequirements(Ess_M2ePro_Model_Listing_Product $listingProduct) { $reasons = $listingProduct->getSynchReasons(); if (empty($reasons)) { return false; } if (!$this->isMeetReviseGeneralRequirements($listingProduct)) { return false; } /** @var Ess_M2ePro_Model_Amazon_Listing_Product $amazonListingProduct */ $amazonListingProduct = $listingProduct->getChildObject(); $synchronizationTemplate = $amazonListingProduct->getSynchronizationTemplate(); $amazonSynchronizationTemplate = $amazonListingProduct->getAmazonSynchronizationTemplate(); foreach ($reasons as $reason) { $method = 'isRevise' . ucfirst($reason); if (method_exists($synchronizationTemplate, $method)) { if ($synchronizationTemplate->{$method}()) { return true; } continue; } if (method_exists($amazonSynchronizationTemplate, $method)) { if ($amazonSynchronizationTemplate->{$method}()) { return true; } continue; } } return false; }