<?php
 namespace App\ImportedOrder\PopulateEntity; class ContactPerson extends GeneralAbstract { protected $importedEntity; protected $importedEntityClass = '\App\ImportedOrder\ContactPerson'; protected $populatingEntityClass = '\Entity\ContactPerson'; public function populate() { $this->populatingEntity->type = 'corporate'; if ($this->importedEntity->lastName!==null) { $this->populatingEntity->lastName = $this->importedEntity->lastName; } if ($this->importedEntity->firstName!==null) { $this->populatingEntity->firstName = $this->importedEntity->firstName; } if ($this->importedEntity->corporate) { $idMatchedCorp = $this->importedEntity->corporate->getMatchedId($this->idExternalSystem); if ($idMatchedCorp) { $this->populatingEntity->idCompany = $idMatchedCorp; } } } }