Ejemplo n.º 1
0
 /**
  * @param Order $entity
  *
  * {@inheritdoc}
  */
 protected function beforeProcessEntity($entity)
 {
     $this->existingEntity = $this->databaseHelper->findOneByIdentity($entity);
     if (!$this->existingEntity) {
         $this->existingEntity = $entity;
     }
     return parent::beforeProcessEntity($entity);
 }
Ejemplo n.º 2
0
 /**
  * @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);
 }
Ejemplo n.º 3
0
 /**
  * @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);
 }