eZ\Publish\Core\Search\Legacy\Content\Common\Gateway\CriterionHandler\FieldValue\HandlerRegistry::has PHP Method

has() public method

Checks if handler is registered for the given $fieldTypeIdentifier.
public has ( string $fieldTypeIdentifier ) : boolean
$fieldTypeIdentifier string
return boolean
    public function has($fieldTypeIdentifier)
    {
        return isset($this->map[$fieldTypeIdentifier]);
    }

Usage Example

Example #1
0
 /**
  * Converts the criteria into query fragments
  *
  * @throws \RuntimeException if Criterion is not applicable to its target
  *
  * @param string $fieldTypeIdentifier
  * @param \eZ\Publish\Core\Persistence\Database\SelectQuery $query
  * @param \eZ\Publish\API\Repository\Values\Content\Query\Criterion $criterion
  * @param string $column
  *
  * @return \eZ\Publish\Core\Persistence\Database\Expression
  */
 public function convertCriteria($fieldTypeIdentifier, SelectQuery $query, Criterion $criterion, $column)
 {
     if ($this->registry->has($fieldTypeIdentifier)) {
         return $this->registry->get($fieldTypeIdentifier)->handle($query, $criterion, $column);
     }
     if ($this->defaultHandler === null) {
         throw new RuntimeException("No conversion for a field type '{$fieldTypeIdentifier}' found.");
     }
     return $this->defaultHandler->handle($query, $criterion, $column);
 }