Contao\Model\Registry::fetchByAlias PHP Method

fetchByAlias() public method

Fetch a model by one of its aliases
public fetchByAlias ( string $strTable, string $strAlias, mixed $varValue ) : Model | null
$strTable string The table name
$strAlias string The alias
$varValue mixed The alias value
return Contao\Model | null The model or null
    public function fetchByAlias($strTable, $strAlias, $varValue)
    {
        if (isset($this->arrAliases[$strTable][$strAlias][$varValue])) {
            $strPk = $this->arrAliases[$strTable][$strAlias][$varValue];
            if (isset($this->arrRegistry[$strTable][$strPk])) {
                return $this->arrRegistry[$strTable][$strPk];
            }
        }
        return null;
    }