DmitryDulepov\Realurl\EncodeDecoderBase::getFromAliasCacheByAliasValue PHP Method

getFromAliasCacheByAliasValue() protected method

(The lookup table for id<->alias is meant to contain UNIQUE alias strings for id integers) In the lookup table 'tx_realurl_uniqalias' the field "value_alias" should be unique (per combination of field_alias+field_id+tablename)! However the "value_id" field doesn't have to; that is a feature which allows more aliases to point to the same id. The alias selected for converting id to alias will be the first inserted at the moment. This might be more intelligent in the future, having an order column which can be controlled from the backend for instance!
protected getFromAliasCacheByAliasValue ( array $configuration, string $aliasValue, boolean $onlyNonExpired ) : integer
$configuration array
$aliasValue string
$onlyNonExpired boolean
return integer ID integer. If none is found: false
    protected function getFromAliasCacheByAliasValue(array $configuration, $aliasValue, $onlyNonExpired)
    {
        $row = $this->databaseConnection->exec_SELECTgetSingleRow('value_id', 'tx_realurl_uniqalias', 'value_alias=' . $this->databaseConnection->fullQuoteStr($aliasValue, 'tx_realurl_uniqalias') . ' AND field_alias=' . $this->databaseConnection->fullQuoteStr($configuration['alias_field'], 'tx_realurl_uniqalias') . ' AND field_id=' . $this->databaseConnection->fullQuoteStr($configuration['id_field'], 'tx_realurl_uniqalias') . ' AND tablename=' . $this->databaseConnection->fullQuoteStr($configuration['table'], 'tx_realurl_uniqalias') . ' AND ' . ($onlyNonExpired ? 'expire=0' : '(expire=0 OR expire>' . time() . ')'));
        return is_array($row) ? (int) $row['value_id'] : false;
    }