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