/** * @param Order $entity * * {@inheritdoc} */ protected function beforeProcessEntity($entity) { $this->existingEntity = $this->databaseHelper->findOneByIdentity($entity); if (!$this->existingEntity) { $this->existingEntity = $entity; } return parent::beforeProcessEntity($entity); }
/** * @param Cart $entity * * {@inheritdoc} */ protected function beforeProcessEntity($entity) { $this->existingEntity = $this->databaseHelper->findOneByIdentity($entity); if ($this->existingEntity) { $this->existingCartItems = $this->existingEntity->getCartItems()->toArray(); } else { $this->existingEntity = $entity; } return parent::beforeProcessEntity($entity); }
/** * @param Customer $entity * @return Customer */ protected function beforeProcessEntity($entity) { $this->importingAddresses = []; $this->addressRegions = []; $importingAddresses = $entity->getAddresses(); if ($importingAddresses) { foreach ($importingAddresses as $address) { $originId = $address->getOriginId(); $this->importingAddresses[$originId] = $address; if ($address->getRegion()) { $this->addressRegions[$originId] = $address->getRegion()->getCombinedCode(); } else { $this->addressRegions[$originId] = null; } } } return parent::beforeProcessEntity($entity); }