PHP Class eZ\Publish\Core\Search\Common\FieldNameResolver

Datei anzeigen Open project: ezsystems/ezpublish-kernel Class Usage Examples

Protected Properties

Property Type Description
$contentTypeHandler eZ\Publish\SPI\Persistence\Content\Type\Handler Content type handler.
$fieldRegistry FieldRegistry Field registry.
$nameGenerator FieldNameGenerator Field name generator.

Public Methods

Method Description
__construct ( FieldRegistry $fieldRegistry, eZ\Publish\SPI\Persistence\Content\Type\Handler $contentTypeHandler, FieldNameGenerator $nameGenerator ) Create from search field registry, content type handler and field name generator.
getFieldNames ( eZ\Publish\API\Repository\Values\Content\Query\Criterion $criterion, string $fieldDefinitionIdentifier, null | string $fieldTypeIdentifier = null, null | string $name = null ) : string[] For the given parameters returns a set of search backend field names to search on.
getFieldTypes ( eZ\Publish\API\Repository\Values\Content\Query\Criterion $criterion, string $fieldDefinitionIdentifier, null | string $fieldTypeIdentifier = null, null | string $name = null ) : array For the given parameters returns a set of search backend field names/types to search on.
getIndexFieldName ( object $criterionOrSortClause, string $contentTypeIdentifier, string $fieldDefinitionIdentifier, string $fieldTypeIdentifier, string $name, boolean $isSortField ) : string Returns index field name for the given parameters.
getSortFieldName ( eZ\Publish\API\Repository\Values\Content\Query\SortClause $sortClause, string $contentTypeIdentifier, string $fieldDefinitionIdentifier, null | string $name = null ) : null | string For the given parameters returns search backend field name to sort on or null if the field could not be found.

Protected Methods

Method Description
getSearchableFieldMap ( ) : array[] Get content type, field definition and field type mapping information.

Method Details

__construct() public method

Create from search field registry, content type handler and field name generator.
public __construct ( FieldRegistry $fieldRegistry, eZ\Publish\SPI\Persistence\Content\Type\Handler $contentTypeHandler, FieldNameGenerator $nameGenerator )
$fieldRegistry FieldRegistry
$contentTypeHandler eZ\Publish\SPI\Persistence\Content\Type\Handler
$nameGenerator FieldNameGenerator

getFieldNames() public method

The method will check for custom fields if given $criterion implements CustomFieldInterface. With optional parameters $fieldTypeIdentifier and $name specific field type and field from its Indexable implementation can be targeted.
See also: eZ\Publish\API\Repository\Values\Content\Query\CustomFieldInterface
See also: eZ\Publish\SPI\FieldType\Indexable
Deprecation: since 6.2, use getFieldTypes instead
public getFieldNames ( eZ\Publish\API\Repository\Values\Content\Query\Criterion $criterion, string $fieldDefinitionIdentifier, null | string $fieldTypeIdentifier = null, null | string $name = null ) : string[]
$criterion eZ\Publish\API\Repository\Values\Content\Query\Criterion
$fieldDefinitionIdentifier string
$fieldTypeIdentifier null | string
$name null | string
return string[]

getFieldTypes() public method

The method will check for custom fields if given $criterion implements CustomFieldInterface. With optional parameters $fieldTypeIdentifier and $name specific field type and field from its Indexable implementation can be targeted.
See also: eZ\Publish\API\Repository\Values\Content\Query\CustomFieldInterface
See also: eZ\Publish\SPI\FieldType\Indexable
public getFieldTypes ( eZ\Publish\API\Repository\Values\Content\Query\Criterion $criterion, string $fieldDefinitionIdentifier, null | string $fieldTypeIdentifier = null, null | string $name = null ) : array
$criterion eZ\Publish\API\Repository\Values\Content\Query\Criterion
$fieldDefinitionIdentifier string
$fieldTypeIdentifier null | string
$name null | string
return array

getIndexFieldName() public method

Returns index field name for the given parameters.
public getIndexFieldName ( object $criterionOrSortClause, string $contentTypeIdentifier, string $fieldDefinitionIdentifier, string $fieldTypeIdentifier, string $name, boolean $isSortField ) : string
$criterionOrSortClause object
$contentTypeIdentifier string
$fieldDefinitionIdentifier string
$fieldTypeIdentifier string
$name string
$isSortField boolean
return string

getSearchableFieldMap() protected method

Returns an array in the form: array( "" => array( "" => array( "field_definition_id" => "", "field_type_identifier" => "", ), ... ), ... )
protected getSearchableFieldMap ( ) : array[]
return array[]

getSortFieldName() public method

The method will check for custom fields if given $sortClause implements CustomFieldInterface. With optional parameter $name specific field from field type's Indexable implementation can be targeted. Will return null if no sortable field is found.
See also: eZ\Publish\API\Repository\Values\Content\Query\CustomFieldInterface
See also: eZ\Publish\SPI\FieldType\Indexable
public getSortFieldName ( eZ\Publish\API\Repository\Values\Content\Query\SortClause $sortClause, string $contentTypeIdentifier, string $fieldDefinitionIdentifier, null | string $name = null ) : null | string
$sortClause eZ\Publish\API\Repository\Values\Content\Query\SortClause
$contentTypeIdentifier string
$fieldDefinitionIdentifier string
$name null | string
return null | string

Property Details

$contentTypeHandler protected_oe property

Content type handler.
protected Handler,eZ\Publish\SPI\Persistence\Content\Type $contentTypeHandler
return eZ\Publish\SPI\Persistence\Content\Type\Handler

$fieldRegistry protected_oe property

Field registry.
protected FieldRegistry,eZ\Publish\Core\Search\Common $fieldRegistry
return FieldRegistry

$nameGenerator protected_oe property

Field name generator.
protected FieldNameGenerator,eZ\Publish\Core\Search\Common $nameGenerator
return FieldNameGenerator