@@ 308-315 (lines=8) @@ | ||
305 | if ($entity instanceof Region) { |
|
306 | /** @var \Oro\Bundle\MagentoBundle\Entity\Region $existingEntity */ |
|
307 | $existingEntity = $this->findRegionEntity($entity); |
|
308 | } elseif ($entity instanceof Customer && !$entity->getOriginId() && $this->existingEntity) { |
|
309 | /** |
|
310 | * Get existing customer entity |
|
311 | * As guest customer entity not exist in Magento as separate entity and saved in order |
|
312 | * find guest by customer email |
|
313 | */ |
|
314 | $existingEntity = $this->findExistingCustomerByContext($this->existingEntity); |
|
315 | } else { |
|
316 | $existingEntity = parent::findExistingEntity($entity, $searchContext); |
|
317 | } |
|
318 |
@@ 111-113 (lines=3) @@ | ||
108 | */ |
|
109 | protected function findExistingEntity($entity, array $searchContext = []) |
|
110 | { |
|
111 | if ($entity instanceof Customer && !$entity->getOriginId() && $this->existingEntity) { |
|
112 | return $this->findExistingCustomerByContext($this->existingEntity); |
|
113 | } |
|
114 | ||
115 | return parent::findExistingEntity($entity, $searchContext); |
|
116 | } |