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