public function fetch($strTable, $varKey, $strAlias = null)
{
/** @var Model $strClass */
$strClass = \Model::getClassFromTable($strTable);
$strPk = $strClass::getPk();
// Search by PK (most common case)
if ($strAlias === null || $strAlias == $strPk) {
if (isset($this->arrRegistry[$strTable][$varKey])) {
return $this->arrRegistry[$strTable][$varKey];
}
return null;
}
// Try to find the model by one of its aliases
return $this->fetchByAlias($strTable, $strAlias, $varKey);
}