<?php
 namespace App\ImportedOrder\EntityMatch; class Supplier extends \App\EntityMatch\Supplier { 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()->getSupplier($options['idSystem'], $value); if ($matchedId) { return $this->searchRecord_primaryKey($matchedId); } else { return null; } } else { return parent::dispatchSearchRecords($field, $value, $useWildcard, $options); } } } 