/** * @param Customer $entity * @return Customer */ protected function afterProcessEntity($entity) { $this->processAddresses($entity); $now = new \DateTime('now', new \DateTimeZone('UTC')); if (!$entity->getImportedAt()) { $entity->setImportedAt($now); } $entity->setSyncedAt($now); $this->appendDataToContext(ContextCustomerReader::CONTEXT_POST_PROCESS_CUSTOMERS, $entity->getOriginId()); return parent::afterProcessEntity($entity); }
/** * @param Cart $entity * * {@inheritdoc} */ protected function afterProcessEntity($entity) { if ($this->existingEntity->getStatus()->getName() === CartStatus::STATUS_OPEN) { $this->updateRemovedCartItems($entity); } if (!$this->hasContactInfo($entity)) { return null; } $this->updateCustomer($entity)->updateAddresses($entity)->updateCartItems($entity)->updateCartStatus($entity); $this->existingEntity = null; $this->existingCartItems = null; return parent::afterProcessEntity($entity); }
/** * @param Order $entity * * {@inheritdoc} */ protected function afterProcessEntity($entity) { if (!$entity->getUpdatedAt() && $entity->getCreatedAt()) { $entity->setUpdatedAt($entity->getCreatedAt()); } /** @var Order $order */ $this->processCart($entity); $this->processItems($entity); $this->processAddresses($entity); $this->processCustomer($entity, $entity->getCustomer()); $this->existingEntity = null; $this->appendDataToContext(self::CONTEXT_ORDER_POST_PROCESS_IDS, $entity->getIncrementId()); return parent::afterProcessEntity($entity); }
/** * @param Cart $entity * * {@inheritdoc} */ protected function afterProcessEntity($entity) { if ($this->existingEntity->getStatus()->getName() === CartStatus::STATUS_OPEN) { $this->updateRemovedCartItems($entity); } if (!$this->hasContactInfo($entity)) { return null; } $this->updateCustomer($entity)->updateAddresses($entity)->updateCartItems($entity)->updateCartStatus($entity); $now = new \DateTime('now', new \DateTimeZone('UTC')); if (!$entity->getImportedAt()) { $entity->setImportedAt($now); } $entity->setSyncedAt($now); $this->existingEntity = null; $this->existingCartItems = null; return parent::afterProcessEntity($entity); }
/** * @param Customer $entity * @return Customer */ protected function afterProcessEntity($entity) { $this->processAddresses($entity); $this->appendDataToContext(ContextCustomerReader::CONTEXT_POST_PROCESS_CUSTOMERS, $entity->getOriginId()); return parent::afterProcessEntity($entity); }
/** * @param NewsletterSubscriber $entity * @return NewsletterSubscriber */ protected function afterProcessEntity($entity) { $this->processChangeStatusAt($entity); return parent::afterProcessEntity($entity); }
/** * @param Customer $entity * * {@inheritdoc} */ protected function afterProcessEntity($entity) { $this->processChangeAttributes($entity); return parent::afterProcessEntity($entity); }