eZ\Publish\Core\Search\Legacy\Content\Common\Gateway\CriterionHandler\FullText::getWordExpression PHP Method

getWordExpression() protected method

Depending on the configuration of the full text search criterion converter wildcards are either transformed into the respective LIKE queries, or everything is just compared using equal.
protected getWordExpression ( eZ\Publish\Core\Persistence\Database\SelectQuery $query, string $token ) : eZ\Publish\Core\Persistence\Database\Expression
$query eZ\Publish\Core\Persistence\Database\SelectQuery
$token string
return eZ\Publish\Core\Persistence\Database\Expression
    protected function getWordExpression(SelectQuery $query, $token)
    {
        if ($this->configuration['enableWildcards'] && $token[0] === '*') {
            return $query->expr->like($this->dbHandler->quoteColumn('word'), $query->bindValue('%' . substr($token, 1)));
        }
        if ($this->configuration['enableWildcards'] && $token[strlen($token) - 1] === '*') {
            return $query->expr->like($this->dbHandler->quoteColumn('word'), $query->bindValue(substr($token, 0, -1) . '%'));
        }
        return $query->expr->eq($this->dbHandler->quoteColumn('word'), $query->bindValue($token));
    }