Best Atoum code snippet using runner.getRunner
Revise.php
Source:Revise.php
...67 [\Ess\M2ePro\Model\ProductChange::UPDATE_ATTRIBUTE_CODE]68 );69 foreach ($changedListingsProducts as $listingProduct) {70 try {71 $isExistInRunner = $this->getRunner()->isExistProductWithAction(72 $listingProduct,73 \Ess\M2ePro\Model\Listing\Product::ACTION_STOP74 );75 if ($isExistInRunner) {76 continue;77 }78 /** @var $configurator \Ess\M2ePro\Model\Ebay\Listing\Product\Action\Configurator */79 $configurator = $this->modelFactory->getObject('Ebay_Listing_Product_Action_Configurator');80 $configurator->reset();81 $configurator->allowQty();82 $configurator->allowVariations();83 $isExistInRunner = $this->getRunner()->isExistProductWithCoveringConfigurator(84 $listingProduct,85 \Ess\M2ePro\Model\Listing\Product::ACTION_REVISE,86 $configurator87 );88 if ($isExistInRunner) {89 continue;90 }91 if (!$this->getInspector()->isMeetReviseQtyRequirements($listingProduct)) {92 continue;93 }94 $this->getRunner()->addProduct(95 $listingProduct,96 \Ess\M2ePro\Model\Listing\Product::ACTION_REVISE,97 $configurator98 );99 } catch (\Exception $exception) {100 $this->logError($listingProduct, $exception, false);101 continue;102 }103 }104 $this->getActualOperationHistory()->saveTimePoint(__METHOD__);105 }106 private function executePriceChanged()107 {108 $this->getActualOperationHistory()->addTimePoint(__METHOD__, 'Update Price');109 /** @var \Ess\M2ePro\Model\Listing\Product[] $changedListingsProducts */110 $changedListingsProducts = $this->getProductChangesManager()->getInstances(111 [\Ess\M2ePro\Model\ProductChange::UPDATE_ATTRIBUTE_CODE]112 );113 foreach ($changedListingsProducts as $listingProduct) {114 try {115 $isExistInRunner = $this->getRunner()->isExistProductWithAction(116 $listingProduct,117 \Ess\M2ePro\Model\Listing\Product::ACTION_STOP118 );119 if ($isExistInRunner) {120 continue;121 }122 /** @var $configurator \Ess\M2ePro\Model\Ebay\Listing\Product\Action\Configurator */123 $configurator = $this->modelFactory->getObject('Ebay_Listing_Product_Action_Configurator');124 $configurator->reset();125 $configurator->allowPrice();126 $configurator->allowVariations();127 $isExistInRunner = $this->getRunner()->isExistProductWithCoveringConfigurator(128 $listingProduct,129 \Ess\M2ePro\Model\Listing\Product::ACTION_REVISE,130 $configurator131 );132 if ($isExistInRunner) {133 continue;134 }135 if (!$this->getInspector()->isMeetRevisePriceRequirements($listingProduct)) {136 continue;137 }138 $this->getRunner()->addProduct(139 $listingProduct,140 \Ess\M2ePro\Model\Listing\Product::ACTION_REVISE,141 $configurator142 );143 } catch (\Exception $exception) {144 $this->logError($listingProduct, $exception, false);145 continue;146 }147 }148 $this->getActualOperationHistory()->saveTimePoint(__METHOD__);149 }150 //########################################151 private function executeTitleChanged()152 {153 $this->getActualOperationHistory()->addTimePoint(__METHOD__, 'Update Title');154 $attributesForProductChange = [];155 $descriptionTemplateCollection = $this->ebayFactory->getObject('Template\Description')->getCollection();156 /** @var \Ess\M2ePro\Model\Template\Description[] $descriptionTemplates */157 $descriptionTemplates = $descriptionTemplateCollection->getItems();158 foreach ($descriptionTemplates as $descriptionTemplate) {159 /** @var \Ess\M2ePro\Model\Ebay\Template\Description $ebayDescriptionTemplate */160 $ebayDescriptionTemplate = $descriptionTemplate->getChildObject();161 $attributesForProductChange = array_merge(162 $attributesForProductChange,163 $ebayDescriptionTemplate->getTitleAttributes()164 );165 }166 /** @var \Ess\M2ePro\Model\Listing\Product[] $changedListingsProducts */167 $changedListingsProducts = $this->getProductChangesManager()->getInstancesByListingProduct(168 array_unique($attributesForProductChange),169 true170 );171 foreach ($changedListingsProducts as $listingProduct) {172 try {173 $isExistInRunner = $this->getRunner()->isExistProductWithAction(174 $listingProduct,175 \Ess\M2ePro\Model\Listing\Product::ACTION_STOP176 );177 if ($isExistInRunner) {178 continue;179 }180 /** @var \Ess\M2ePro\Model\Ebay\Listing\Product $ebayListingProduct */181 $ebayListingProduct = $listingProduct->getChildObject();182 $titleAttributes = $ebayListingProduct->getEbayDescriptionTemplate()->getTitleAttributes();183 if (!in_array($listingProduct->getData('changed_attribute'), $titleAttributes)) {184 continue;185 }186 /** @var $configurator \Ess\M2ePro\Model\Ebay\Listing\Product\Action\Configurator */187 $configurator = $this->modelFactory->getObject('Ebay_Listing_Product_Action_Configurator');188 $configurator->reset();189 $configurator->allowTitle();190 $isExistInRunner = $this->getRunner()->isExistProductWithCoveringConfigurator(191 $listingProduct,192 \Ess\M2ePro\Model\Listing\Product::ACTION_REVISE,193 $configurator194 );195 if ($isExistInRunner) {196 continue;197 }198 if (!$this->getInspector()->isMeetReviseTitleRequirements($listingProduct, false)) {199 continue;200 }201 $this->getRunner()->addProduct(202 $listingProduct,203 \Ess\M2ePro\Model\Listing\Product::ACTION_REVISE,204 $configurator205 );206 } catch (\Exception $exception) {207 $this->logError($listingProduct, $exception, false);208 continue;209 }210 }211 }212 private function executeSubTitleChanged()213 {214 $this->getActualOperationHistory()->addTimePoint(__METHOD__, 'Update Subtitle');215 $attributesForProductChange = [];216 $descriptionTemplateCollection = $this->ebayFactory->getObject('Template\Description')->getCollection();217 /** @var \Ess\M2ePro\Model\Template\Description[] $descriptionTemplates */218 $descriptionTemplates = $descriptionTemplateCollection->getItems();219 foreach ($descriptionTemplates as $descriptionTemplate) {220 /** @var \Ess\M2ePro\Model\Ebay\Template\Description $ebayDescriptionTemplate */221 $ebayDescriptionTemplate = $descriptionTemplate->getChildObject();222 $attributesForProductChange = array_merge(223 $attributesForProductChange,224 $ebayDescriptionTemplate->getSubTitleAttributes()225 );226 }227 /** @var \Ess\M2ePro\Model\Listing\Product[] $changedListingsProducts */228 $changedListingsProducts = $this->getProductChangesManager()->getInstancesByListingProduct(229 array_unique($attributesForProductChange),230 true231 );232 foreach ($changedListingsProducts as $listingProduct) {233 try {234 $isExistInRunner = $this->getRunner()->isExistProductWithAction(235 $listingProduct,236 \Ess\M2ePro\Model\Listing\Product::ACTION_STOP237 );238 if ($isExistInRunner) {239 continue;240 }241 /** @var \Ess\M2ePro\Model\Ebay\Listing\Product $ebayListingProduct */242 $ebayListingProduct = $listingProduct->getChildObject();243 $subTitleAttributes = $ebayListingProduct->getEbayDescriptionTemplate()->getSubTitleAttributes();244 if (!in_array($listingProduct->getData('changed_attribute'), $subTitleAttributes)) {245 continue;246 }247 /** @var $configurator \Ess\M2ePro\Model\Ebay\Listing\Product\Action\Configurator */248 $configurator = $this->modelFactory->getObject('Ebay_Listing_Product_Action_Configurator');249 $configurator->reset();250 $configurator->allowSubtitle();251 $isExistInRunner = $this->getRunner()->isExistProductWithCoveringConfigurator(252 $listingProduct,253 \Ess\M2ePro\Model\Listing\Product::ACTION_REVISE,254 $configurator255 );256 if ($isExistInRunner) {257 continue;258 }259 if (!$this->getInspector()->isMeetReviseSubTitleRequirements($listingProduct, false)) {260 continue;261 }262 $this->getRunner()->addProduct(263 $listingProduct,264 \Ess\M2ePro\Model\Listing\Product::ACTION_REVISE,265 $configurator266 );267 } catch (\Exception $exception) {268 $this->logError($listingProduct, $exception, false);269 continue;270 }271 }272 $this->getActualOperationHistory()->saveTimePoint(__METHOD__);273 }274 private function executeDescriptionChanged()275 {276 $this->getActualOperationHistory()->addTimePoint(__METHOD__, 'Update Description');277 $attributesForProductChange = [];278 $descriptionTemplateCollection = $this->ebayFactory->getObject('Template\Description')->getCollection();279 /** @var \Ess\M2ePro\Model\Template\Description[] $descriptionTemplates */280 $descriptionTemplates = $descriptionTemplateCollection->getItems();281 foreach ($descriptionTemplates as $descriptionTemplate) {282 /** @var \Ess\M2ePro\Model\Ebay\Template\Description $ebayDescriptionTemplate */283 $ebayDescriptionTemplate = $descriptionTemplate->getChildObject();284 $attributesForProductChange = array_merge(285 $attributesForProductChange,286 $ebayDescriptionTemplate->getDescriptionAttributes()287 );288 }289 /** @var \Ess\M2ePro\Model\Listing\Product[] $changedListingsProducts */290 $changedListingsProducts = $this->getProductChangesManager()->getInstancesByListingProduct(291 array_unique($attributesForProductChange),292 true293 );294 foreach ($changedListingsProducts as $listingProduct) {295 try {296 $isExistInRunner = $this->getRunner()->isExistProductWithAction(297 $listingProduct,298 \Ess\M2ePro\Model\Listing\Product::ACTION_STOP299 );300 if ($isExistInRunner) {301 continue;302 }303 /** @var \Ess\M2ePro\Model\Ebay\Listing\Product $ebayListingProduct */304 $ebayListingProduct = $listingProduct->getChildObject();305 $descriptionAttributes = $ebayListingProduct->getEbayDescriptionTemplate()->getDescriptionAttributes();306 if (!in_array($listingProduct->getData('changed_attribute'), $descriptionAttributes)) {307 continue;308 }309 /** @var $configurator \Ess\M2ePro\Model\Ebay\Listing\Product\Action\Configurator */310 $configurator = $this->modelFactory->getObject('Ebay_Listing_Product_Action_Configurator');311 $configurator->reset();312 $configurator->allowDescription();313 $isExistInRunner = $this->getRunner()->isExistProductWithCoveringConfigurator(314 $listingProduct,315 \Ess\M2ePro\Model\Listing\Product::ACTION_REVISE,316 $configurator317 );318 if ($isExistInRunner) {319 continue;320 }321 if (!$this->getInspector()->isMeetReviseDescriptionRequirements($listingProduct, false)) {322 continue;323 }324 $this->getRunner()->addProduct(325 $listingProduct,326 \Ess\M2ePro\Model\Listing\Product::ACTION_REVISE,327 $configurator328 );329 } catch (\Exception $exception) {330 $this->logError($listingProduct, $exception, false);331 continue;332 }333 }334 $this->getActualOperationHistory()->saveTimePoint(__METHOD__);335 }336 private function executeImagesChanged()337 {338 $this->getActualOperationHistory()->addTimePoint(__METHOD__, 'Update images');339 $attributesForProductChange = [];340 $descriptionTemplateCollection = $this->ebayFactory->getObject('Template\Description')->getCollection();341 /** @var \Ess\M2ePro\Model\Template\Description[] $descriptionTemplates */342 $descriptionTemplates = $descriptionTemplateCollection->getItems();343 foreach ($descriptionTemplates as $descriptionTemplate) {344 /** @var \Ess\M2ePro\Model\Ebay\Template\Description $ebayDescriptionTemplate */345 $ebayDescriptionTemplate = $descriptionTemplate->getChildObject();346 $attributesForProductChange = array_merge(347 $attributesForProductChange,348 $ebayDescriptionTemplate->getImageMainAttributes(),349 $ebayDescriptionTemplate->getGalleryImagesAttributes()350 );351 }352 $attributesForProductChange = array_unique($attributesForProductChange);353 /** @var \Ess\M2ePro\Model\Listing\Product[] $changedListingsProducts */354 $changedListingsProducts = $this->getProductChangesManager()->getInstancesByListingProduct(355 $attributesForProductChange,356 true357 );358 foreach ($changedListingsProducts as $listingProduct) {359 try {360 $isExistInRunner = $this->getRunner()->isExistProductWithAction(361 $listingProduct,362 \Ess\M2ePro\Model\Listing\Product::ACTION_STOP363 );364 if ($isExistInRunner) {365 continue;366 }367 /** @var \Ess\M2ePro\Model\Ebay\Listing\Product $ebayListingProduct */368 $ebayListingProduct = $listingProduct->getChildObject();369 $imagesAttributes = array_merge(370 $ebayListingProduct->getEbayDescriptionTemplate()->getImageMainAttributes(),371 $ebayListingProduct->getEbayDescriptionTemplate()->getGalleryImagesAttributes()372 );373 if (!in_array($listingProduct->getData('changed_attribute'), $imagesAttributes)) {374 continue;375 }376 /** @var $configurator \Ess\M2ePro\Model\Ebay\Listing\Product\Action\Configurator */377 $configurator = $this->modelFactory->getObject('Ebay_Listing_Product_Action_Configurator');378 $configurator->reset();379 $configurator->allowImages();380 $isExistInRunner = $this->getRunner()->isExistProductWithCoveringConfigurator(381 $listingProduct,382 \Ess\M2ePro\Model\Listing\Product::ACTION_REVISE,383 $configurator384 );385 if ($isExistInRunner) {386 continue;387 }388 if (!$this->getInspector()->isMeetReviseImagesRequirements($listingProduct, false)) {389 continue;390 }391 $this->getRunner()->addProduct(392 $listingProduct,393 \Ess\M2ePro\Model\Listing\Product::ACTION_REVISE,394 $configurator395 );396 } catch (\Exception $exception) {397 $this->logError($listingProduct, $exception, false);398 continue;399 }400 }401 foreach ($descriptionTemplates as $descriptionTemplate) {402 /** @var \Ess\M2ePro\Model\Ebay\Template\Description $ebayDescriptionTemplate */403 $ebayDescriptionTemplate = $descriptionTemplate->getChildObject();404 $attributesForProductChange = array_merge(405 $attributesForProductChange,406 $ebayDescriptionTemplate->getVariationImagesAttributes()407 );408 }409 /** @var \Ess\M2ePro\Model\Listing\Product[] $changedListingsProductsByVariationOption */410 $changedListingsProductsByVariationOption = $this->getProductChangesManager()->getInstancesByVariationOption(411 array_unique($attributesForProductChange),412 true413 );414 foreach ($changedListingsProductsByVariationOption as $listingProduct) {415 try {416 /** @var \Ess\M2ePro\Model\Ebay\Listing\Product $ebayListingProduct */417 $ebayListingProduct = $listingProduct->getChildObject();418 $imagesAttributes = $ebayListingProduct->getEbayDescriptionTemplate()->getVariationImagesAttributes();419 if (!in_array($listingProduct->getData('changed_attribute'), $imagesAttributes)) {420 continue;421 }422 /** @var $configurator \Ess\M2ePro\Model\Ebay\Listing\Product\Action\Configurator */423 $configurator = $this->modelFactory->getObject('Ebay_Listing_Product_Action_Configurator');424 $configurator->reset();425 $configurator->allowVariations();426 $isExistInRunner = $this->getRunner()->isExistProductWithCoveringConfigurator(427 $listingProduct,428 \Ess\M2ePro\Model\Listing\Product::ACTION_REVISE,429 $configurator430 );431 if ($isExistInRunner) {432 continue;433 }434 if (!$this->getInspector()->isMeetReviseImagesRequirements($listingProduct, false)) {435 continue;436 }437 $this->getRunner()->addProduct(438 $listingProduct,439 \Ess\M2ePro\Model\Listing\Product::ACTION_REVISE,440 $configurator441 );442 } catch (\Exception $exception) {443 $this->logError($listingProduct, $exception, false);444 continue;445 }446 }447 $this->getActualOperationHistory()->saveTimePoint(__METHOD__);448 }449 private function executeSpecificsChanged()450 {451 $this->getActualOperationHistory()->addTimePoint(__METHOD__, 'Update specifics');452 /** @var \Ess\M2ePro\Model\Listing\Product[] $changedListingsProducts */453 $changedListingsProducts = $this->getProductChangesManager()->getInstances(454 [\Ess\M2ePro\Model\ProductChange::UPDATE_ATTRIBUTE_CODE]455 );456 $attributesForProductChange = [];457 foreach ($changedListingsProducts as $listingProduct) {458 /** @var \Ess\M2ePro\Model\Ebay\Listing\Product $ebayListingProduct */459 $ebayListingProduct = $listingProduct->getChildObject();460 if ($ebayListingProduct->isSetCategoryTemplate()) {461 $attributesForProductChange = array_merge(462 $attributesForProductChange,463 $ebayListingProduct->getCategoryTemplate()->getTrackingAttributes()464 );465 }466 }467 $attributesForProductChange = array_unique($attributesForProductChange);468 /** @var \Ess\M2ePro\Model\Listing\Product[] $changedListingsProducts */469 $changedListingsProducts = $this->getProductChangesManager()->getInstancesByListingProduct(470 $attributesForProductChange,471 true472 );473 foreach ($changedListingsProducts as $listingProduct) {474 try {475 $isExistInRunner = $this->getRunner()->isExistProductWithAction(476 $listingProduct,477 \Ess\M2ePro\Model\Listing\Product::ACTION_STOP478 );479 if ($isExistInRunner) {480 continue;481 }482 /** @var \Ess\M2ePro\Model\Ebay\Listing\Product $ebayListingProduct */483 $ebayListingProduct = $listingProduct->getChildObject();484 if (!$ebayListingProduct->isSetCategoryTemplate()) {485 continue;486 }487 $specificsAttributes = $ebayListingProduct->getCategoryTemplate()->getTrackingAttributes();488 if (!in_array($listingProduct->getData('changed_attribute'), $specificsAttributes)) {489 continue;490 }491 /** @var $configurator \Ess\M2ePro\Model\Ebay\Listing\Product\Action\Configurator */492 $configurator = $this->modelFactory->getObject('Ebay_Listing_Product_Action_Configurator');493 $configurator->reset();494 $configurator->allowSpecifics();495 $isExistInRunner = $this->getRunner()->isExistProductWithCoveringConfigurator(496 $listingProduct,497 \Ess\M2ePro\Model\Listing\Product::ACTION_REVISE,498 $configurator499 );500 if ($isExistInRunner) {501 continue;502 }503 if (!$this->getInspector()->isMeetReviseSpecificsRequirements($listingProduct, false)) {504 continue;505 }506 $this->getRunner()->addProduct(507 $listingProduct,508 \Ess\M2ePro\Model\Listing\Product::ACTION_REVISE,509 $configurator510 );511 } catch (\Exception $exception) {512 $this->logError($listingProduct, $exception, false);513 continue;514 }515 }516 $this->getActualOperationHistory()->saveTimePoint(__METHOD__);517 }518 private function executeShippingServicesChanged()519 {520 $this->getActualOperationHistory()->addTimePoint(__METHOD__, 'Update shipping services');521 /** @var \Ess\M2ePro\Model\Listing\Product[] $changedListingsProducts */522 $changedListingsProducts = $this->getProductChangesManager()->getInstances(523 [\Ess\M2ePro\Model\ProductChange::UPDATE_ATTRIBUTE_CODE]524 );525 $attributesForProductChange = [];526 foreach ($changedListingsProducts as $listingProduct) {527 /** @var \Ess\M2ePro\Model\Ebay\Listing\Product $ebayListingProduct */528 $ebayListingProduct = $listingProduct->getChildObject();529 $attributesForProductChange = array_merge(530 $attributesForProductChange,531 $ebayListingProduct->getShippingTemplate()->getTrackingAttributes()532 );533 }534 $attributesForProductChange = array_unique($attributesForProductChange);535 /** @var \Ess\M2ePro\Model\Listing\Product[] $changedListingsProducts */536 $changedListingsProducts = $this->getProductChangesManager()->getInstancesByListingProduct(537 $attributesForProductChange,538 true539 );540 foreach ($changedListingsProducts as $listingProduct) {541 try {542 $isExistInRunner = $this->getRunner()->isExistProductWithAction(543 $listingProduct,544 \Ess\M2ePro\Model\Listing\Product::ACTION_STOP545 );546 if ($isExistInRunner) {547 continue;548 }549 /** @var \Ess\M2ePro\Model\Ebay\Listing\Product $ebayListingProduct */550 $ebayListingProduct = $listingProduct->getChildObject();551 $servicesAttributes = $ebayListingProduct->getShippingTemplate()->getTrackingAttributes();552 if (!in_array($listingProduct->getData('changed_attribute'), $servicesAttributes)) {553 continue;554 }555 /** @var $configurator \Ess\M2ePro\Model\Ebay\Listing\Product\Action\Configurator */556 $configurator = $this->modelFactory->getObject('Ebay_Listing_Product_Action_Configurator');557 $configurator->reset();558 $configurator->allowShippingServices();559 $isExistInRunner = $this->getRunner()->isExistProductWithCoveringConfigurator(560 $listingProduct,561 \Ess\M2ePro\Model\Listing\Product::ACTION_REVISE,562 $configurator563 );564 if ($isExistInRunner) {565 continue;566 }567 if (!$this->getInspector()->isMeetReviseShippingServicesRequirements($listingProduct)) {568 continue;569 }570 $this->getRunner()->addProduct(571 $listingProduct,572 \Ess\M2ePro\Model\Listing\Product::ACTION_REVISE,573 $configurator574 );575 } catch (\Exception $exception) {576 $this->logError($listingProduct, $exception, false);577 continue;578 }579 }580 $this->getActualOperationHistory()->saveTimePoint(__METHOD__);581 }582 //########################################583 private function executePickupStoreQtyChanged()584 {585 $this->getActualOperationHistory()->addTimePoint(__METHOD__, 'Update Pickup Store Quantity');586 /** @var \Ess\M2ePro\Model\Listing\Product[] $changedListingsProducts */587 $changedListingsProducts = $this->getProductChangesManager()->getInstances(588 [\Ess\M2ePro\Model\ProductChange::UPDATE_ATTRIBUTE_CODE]589 );590 foreach ($changedListingsProducts as $listingProduct) {591 try {592 /** @var \Ess\M2ePro\Model\Ebay\Listing\Product $ebayListingProduct */593 $ebayListingProduct = $listingProduct->getChildObject();594 if (!$ebayListingProduct->getEbayAccount()->isPickupStoreEnabled()) {595 continue;596 }597 $ebaySynchronizationTemplate = $ebayListingProduct->getEbaySynchronizationTemplate();598 if (!$ebaySynchronizationTemplate->isReviseWhenChangeQty()) {599 continue;600 }601 /** @var \Ess\M2ePro\Model\Ebay\Listing\Product\PickupStore\State\Updater $pickupStoreStateUpdater */602 $pickupStoreStateUpdater = $this->modelFactory->getObject(603 'Ebay_Listing_Product_PickupStore_State_Updater'604 );605 $pickupStoreStateUpdater->setListingProduct($listingProduct);606 if ($ebaySynchronizationTemplate->isReviseUpdateQtyMaxAppliedValueModeOn()) {607 $pickupStoreStateUpdater->setMaxAppliedQtyValue(608 $ebaySynchronizationTemplate->getReviseUpdateQtyMaxAppliedValue()609 );610 }611 $pickupStoreStateUpdater->process();612 } catch (\Exception $exception) {613 $this->logError($listingProduct, $exception, false);614 continue;615 }616 }617 $this->getActualOperationHistory()->saveTimePoint(__METHOD__);618 }619 //########################################620 private function executeNeedSynchronize()621 {622 $this->getActualOperationHistory()->addTimePoint(__METHOD__, 'Execute is need synchronize');623 $listingProductCollection = $this->ebayFactory->getObject('Listing\Product')->getCollection();624 $listingProductCollection->addFieldToFilter('status', \Ess\M2ePro\Model\Listing\Product::STATUS_LISTED);625 $listingProductCollection->addFieldToFilter(626 'synch_status',627 \Ess\M2ePro\Model\Listing\Product::SYNCH_STATUS_NEED628 );629 $tag = 'in_action';630 $modelName = $this->activeRecordFactory->getObject('Listing\Product')->getResourceName();631 $limit = $this->getConfigValue($this->getFullSettingsPath().'need_synch/', 'items_limit');632 $listingProductCollection->getSelect()->joinLeft(633 [634 'mpc' => $this->getHelper('Module_Database_Structure')->getTableNameWithPrefix('m2epro_processing_lock')635 ],636 "mpc.object_id = main_table.id AND mpc.tag='{$tag}' AND mpc.model_name = '{$modelName}'",637 []638 );639 $listingProductCollection->addFieldToFilter('mpc.id', ['null' => true]);640 $listingProductCollection->getSelect()->limit($limit);641 foreach ($listingProductCollection->getItems() as $listingProduct) {642 try {643 /** @var $listingProduct \Ess\M2ePro\Model\Listing\Product */644 $listingProduct->setData('synch_status', \Ess\M2ePro\Model\Listing\Product::SYNCH_STATUS_SKIP)->save();645 $isExistInRunner = $this->getRunner()->isExistProductWithAction(646 $listingProduct,647 \Ess\M2ePro\Model\Listing\Product::ACTION_STOP648 );649 if ($isExistInRunner) {650 continue;651 }652 /** @var $configurator \Ess\M2ePro\Model\Ebay\Listing\Product\Action\Configurator */653 $configurator = $this->modelFactory->getObject('Ebay_Listing_Product_Action_Configurator');654 $isExistInRunner = $this->getRunner()->isExistProductWithCoveringConfigurator(655 $listingProduct,656 \Ess\M2ePro\Model\Listing\Product::ACTION_REVISE,657 $configurator658 );659 if ($isExistInRunner) {660 continue;661 }662 if (!$this->getInspector()->isMeetReviseSynchReasonsRequirements($listingProduct, false)) {663 continue;664 }665 $this->getRunner()->addProduct(666 $listingProduct,667 \Ess\M2ePro\Model\Listing\Product::ACTION_REVISE,668 $configurator669 );670 } catch (\Exception $exception) {671 $this->logError($listingProduct, $exception, false);672 continue;673 }674 }675 $this->getActualOperationHistory()->saveTimePoint(__METHOD__);676 }677 private function executeTotal()678 {679 $this->getActualOperationHistory()->addTimePoint(__METHOD__, 'Execute Revise all');680 $lastListingProductProcessed = $this->getConfigValue(681 $this->getFullSettingsPath().'total/',682 'last_listing_product_id'683 );684 if ($lastListingProductProcessed === null) {685 return;686 }687 $itemsPerCycle = $this->getConfigValue($this->getFullSettingsPath().'total/', 'items_limit');688 $collection = $this->ebayFactory->getObject('Listing\Product')689 ->getCollection()690 ->addFieldToFilter('id', ['gt' => $lastListingProductProcessed])691 ->addFieldToFilter('status', \Ess\M2ePro\Model\Listing\Product::STATUS_LISTED);692 $collection->getSelect()->limit($itemsPerCycle);693 $collection->getSelect()->order('id ASC');694 /** @var $listingProduct \Ess\M2ePro\Model\Listing\Product */695 foreach ($collection->getItems() as $listingProduct) {696 try {697 $isExistInRunner = $this->getRunner()->isExistProductWithAction(698 $listingProduct,699 \Ess\M2ePro\Model\Listing\Product::ACTION_STOP700 );701 if ($isExistInRunner) {702 continue;703 }704 /** @var $configurator \Ess\M2ePro\Model\Ebay\Listing\Product\Action\Configurator */705 $configurator = $this->modelFactory->getObject('Ebay_Listing_Product_Action_Configurator');706 $isExistInRunner = $this->getRunner()->isExistProductWithCoveringConfigurator(707 $listingProduct,708 \Ess\M2ePro\Model\Listing\Product::ACTION_REVISE,709 $configurator710 );711 if ($isExistInRunner) {712 continue;713 }714 if (!$this->getInspector()->isMeetReviseGeneralRequirements($listingProduct, false)) {715 continue;716 }717 $this->getRunner()->addProduct(718 $listingProduct,719 \Ess\M2ePro\Model\Listing\Product::ACTION_REVISE,720 $configurator721 );722 } catch (\Exception $exception) {723 $this->logError($listingProduct, $exception, false);724 continue;725 }726 }727 $lastListingProduct = $collection->getLastItem()->getId();728 if ($collection->getSize() < $itemsPerCycle) {729 $this->setConfigValue(730 $this->getFullSettingsPath().'total/',731 'end_date',...
AcfTest.php
Source:AcfTest.php
...23 public function fieldBuilderUsesRunnerWithFieldBehavior()24 {25 $this->assertInstanceOf(26 FieldBehavior::class,27 Acf::field('foo')->getRunner()->getBehavior()28 );29 }30 /** @test */31 public function subFieldBuilderUsesRunnerWithSubFieldBehavior()32 {33 $this->assertInstanceOf(34 SubFieldBehavior::class,35 Acf::subField('foo')->getRunner()->getBehavior()36 );37 }38 /** @test */39 public function optionBuilderUsesRunnerWithFieldBehavior()40 {41 $this->assertInstanceOf(42 FieldBehavior::class,43 Acf::option('foo')->getRunner()->getBehavior()44 );45 }46 /** @test */47 public function optionBuilderUsesOptionPost()48 {49 $this->assertEquals('option', Acf::option('foo')->id);50 }51 /** @test */52 public function sameBuilderInRunner()53 {54 $one = Acf::field('foo');55 $two = Acf::field('bar');56 $three = Acf::subField('baz');57 // Make sure that both `field` queries use the same behavior instance...58 $this->assertSame(59 $one->getRunner()->getBehavior(),60 $two->getRunner()->getBehavior()61 );62 // ...But the `subField` query should have its own behavior.63 $this->assertNotSame(64 $one->getRunner()->getBehavior(),65 $three->getRunner()->getBehavior()66 );67 }68 /** @test */69 public function setIdOnFieldMethod()70 {71 $this->assertEquals(2, Acf::field('foo', 2)->id);72 }73 /** @test */74 public function fluentCall()75 {76 $value = Acf::field('title')77 ->expect('string')78 ->default('Hello World')79 ->get();...
getRunner
Using AI Code Generation
1$runner = new Runner();2$runner->getRunner();3$runner = new Runner();4$runner->getRunner();5$runner = new Runner();6$runner->getRunner();
getRunner
Using AI Code Generation
1$runner = new Runner();2$runner->getRunner();3$runner = new Runner();4$runner->getRunner();5$runner = new Runner();6$runner->getRunner();
getRunner
Using AI Code Generation
1$runner = new Runner();2$runner->getRunner();3$runner = new Runner();4$runner->getRunner();5$runner = new Runner();6$runner->getRunner();7$runner = new Runner();8$runner->getRunner();9$runner = new Runner();10$runner->getRunner();11$runner = new Runner();12$runner->getRunner();13$runner = new Runner();14$runner->getRunner();15$runner = new Runner();16$runner->getRunner();17$runner = new Runner();18$runner->getRunner();19$runner = new Runner();20$runner->getRunner();21$runner = new Runner();22$runner->getRunner();23$runner = new Runner();24$runner->getRunner();25$runner = new Runner();26$runner->getRunner();27$runner = new Runner();28$runner->getRunner();29$runner = new Runner();30$runner->getRunner();31$runner = new Runner();32$runner->getRunner();33$runner = new Runner();34$runner->getRunner();
getRunner
Using AI Code Generation
1require_once 'runner.php';2$runner = new Runner();3$runner->getRunner();4require_once 'runner.php';5$runner = new Runner();6$runner->getRunner();7class Runner {8 public function getRunner() {9 echo "I am running!";10 }11}
getRunner
Using AI Code Generation
1$runner = new runner();2$runner->getRunner();3$runner = new runner();4$runner->getRunner();5$runner = new runner();6$runner->getRunner();7$runner = new runner();8$runner->getRunner();9$runner = new runner();10$runner->getRunner();11$runner = new runner();12$runner->getRunner();13$runner = new runner();14$runner->getRunner();15$runner = new runner();16$runner->getRunner();17$runner = new runner();18$runner->getRunner();19$runner = new runner();20$runner->getRunner();21$runner = new runner();22$runner->getRunner();23$runner = new runner();24$runner->getRunner();25$runner = new runner();26$runner->getRunner();27$runner = new runner();28$runner->getRunner();29$runner = new runner();30$runner->getRunner();31$runner = new runner();32$runner->getRunner();33$runner = new runner();34$runner->getRunner();
getRunner
Using AI Code Generation
1$runner = new Runner();2$runner->getRunner();3$runner = new Runner();4$runner->getRunner();5$runner = new Runner();6$runner->getRunner();7$runner = new Runner();8$runner->getRunner();9$runner = new Runner();10$runner->getRunner();11$runner = new Runner();12$runner->getRunner();13$runner = new Runner();14$runner->getRunner();15$runner = new Runner();16$runner->getRunner();17$runner = new Runner();18$runner->getRunner();19$runner = new Runner();20$runner->getRunner();21$runner = new Runner();22$runner->getRunner();23$runner = new Runner();24$runner->getRunner();25$runner = new Runner();26$runner->getRunner();27$runner = new Runner();
getRunner
Using AI Code Generation
1require_once("runner.php");2$runner = new Runner();3$runner->getRunner();4require_once("1.php");5{6 public function getRunner()7 {8 $one = new One();9 $one->getOne();10 }11}12{13 public function getOne()14 {15 echo "getOne";16 }17}
getRunner
Using AI Code Generation
1require_once 'runner.php';2$runner = new Runner();3$runner->getRunner();4class Runner {5 public function getRunner() {6 $this->runner = new Runner();7 $this->runner->getRunner();8 }9}
Learn to execute automation testing from scratch with LambdaTest Learning Hub. Right from setting up the prerequisites to run your first automation test, to following best practices and diving deeper into advanced test scenarios. LambdaTest Learning Hubs compile a list of step-by-step guides to help you be proficient with different test automation frameworks i.e. Selenium, Cypress, TestNG etc.
You could also refer to video tutorials over LambdaTest YouTube channel to get step by step demonstration from industry experts.
Execute automation tests with getRunner on a cloud-based Grid of 3000+ real browsers and operating systems for both web and mobile applications.
Test now for FreeGet 100 minutes of automation test minutes FREE!!