Contao\Model\Registry::fetchByAlias PHP Méthode

fetchByAlias() public méthode

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
Résultat 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;
    }