<?php
 namespace App\ImportedOrder\EntityMatch; class Customer extends \App\EntityMatch\Customer { use \App\ImportedOrder\EntityMatch\ExtSysCleanMatchesTrait; public function setIdInExtSys($idEntityExtSys, $idSystem) { $this->setSearchCriterion('ordersExtSys', $idEntityExtSys, false, ['idSystem'=>$idSystem]); } protected function dispatchSearchRecords($field, $value, $useWildcard, Array $options=[]) { if ($field=='ordersExtSys') { $matchedId = \App\Config\ImportedOrders_Matches::getInstance()->getCustomer($options['idSystem'], $value); if ($matchedId) { return $this->searchRecord_primaryKey($matchedId); } else { return null; } } else { return parent::dispatchSearchRecords($field, $value, $useWildcard, $options); } } } 