<?php
 namespace App\ImportedOrder\PopulateEntity; class FrequentBuyerCard extends GeneralAbstract { protected $importedEntity; protected $importedEntityClass = '\App\ImportedOrder\Passenger_FbCard'; protected $populatingEntityClass = '\Entity\FrequentBuyerCard'; public function populate() { if ($this->importedEntity->number!==null) { $this->populatingEntity->cardNumber = $this->importedEntity->number; } if ($this->importedEntity->suppliers) { $suppliersList = []; foreach($this->importedEntity->suppliers as $supp) { $idMatchedSupplier = $supp->getMatchedId($this->idExternalSystem); if ($idMatchedSupplier) { $suppliersList[] = $idMatchedSupplier; } } if ($suppliersList) { $this->populatingEntity->suppliersList = $suppliersList; } } } } 