PHP Class eZ\Publish\Core\FieldType\Relation\Type

This field type represents a relation to a content. hash format ({@see \fromhash()}, {@see \toHash()}): array( 'destinationContentId' => (int)$destinationContentId );
Inheritance: extends eZ\Publish\Core\FieldType\FieldType
Datei anzeigen Open project: ezsystems/ezpublish-kernel Class Usage Examples

Protected Properties

Property Type Description
$settingsSchema

Public Methods

Method Description
fromHash ( mixed $hash ) : Value Converts an $hash to the Value defined by the field type.
getEmptyValue ( ) : Value Returns the fallback default value of field type when no such default value is provided in the field definition in content types.
getFieldTypeIdentifier ( ) : string Returns the field type identifier for this field type.
getName ( eZ\Publish\SPI\FieldType\Value $value ) : string Returns the name of the given field value.
getRelations ( eZ\Publish\SPI\FieldType\Value $fieldValue ) : array Returns relation data extracted from value.
isEmptyValue ( eZ\Publish\SPI\FieldType\Value $value ) : boolean Returns if the given $value is considered empty by the field type.
isSearchable ( ) : boolean Returns whether the field type is searchable.
toHash ( eZ\Publish\SPI\FieldType\Value $value ) : mixed Converts a $Value to a hash.
validateFieldSettings ( mixed $fieldSettings ) : eZ\Publish\SPI\FieldType\ValidationError[]

Protected Methods

Method Description
checkValueStructure ( Value $value ) Throws an exception if value structure is not of expected format.
createValueFromInput ( integer | string | eZ\Publish\API\Repository\Values\Content\ContentInfo | Value $inputValue ) : Value Inspects given $inputValue and potentially converts it into a dedicated value object.
getSortInfo ( Value $value ) : mixed Returns information for FieldValue->$sortKey relevant to the field type.

Method Details

checkValueStructure() protected method

Throws an exception if value structure is not of expected format.
protected checkValueStructure ( Value $value )
$value eZ\Publish\Core\FieldType\Value

createValueFromInput() protected method

Inspects given $inputValue and potentially converts it into a dedicated value object.
protected createValueFromInput ( integer | string | eZ\Publish\API\Repository\Values\Content\ContentInfo | Value $inputValue ) : Value
$inputValue integer | string | eZ\Publish\API\Repository\Values\Content\ContentInfo | Value
return Value The potentially converted and structurally plausible value.

fromHash() public method

Converts an $hash to the Value defined by the field type.
public fromHash ( mixed $hash ) : Value
$hash mixed
return Value $value

getEmptyValue() public method

Returns the fallback default value of field type when no such default value is provided in the field definition in content types.
public getEmptyValue ( ) : Value
return Value

getFieldTypeIdentifier() public method

Returns the field type identifier for this field type.
public getFieldTypeIdentifier ( ) : string
return string

getName() public method

It will be used to generate content name and url alias if current field is designated to be used in the content name/urlAlias pattern.
public getName ( eZ\Publish\SPI\FieldType\Value $value ) : string
$value eZ\Publish\SPI\FieldType\Value
return string

getRelations() public method

Not intended for \eZ\Publish\API\Repository\Values\Content\Relation::COMMON type relations, there is an API for handling those.
public getRelations ( eZ\Publish\SPI\FieldType\Value $fieldValue ) : array
$fieldValue eZ\Publish\SPI\FieldType\Value
return array Hash with relation type as key and array of destination content ids as value. Example: array( \eZ\Publish\API\Repository\Values\Content\Relation::LINK => array( "contentIds" => array( 12, 13, 14 ), "locationIds" => array( 24 ) ), \eZ\Publish\API\Repository\Values\Content\Relation::EMBED => array( "contentIds" => array( 12 ), "locationIds" => array( 24, 45 ) ), \eZ\Publish\API\Repository\Values\Content\Relation::ATTRIBUTE => array( 12 ) )

getSortInfo() protected method

For this FieldType, the related object's name is returned.
protected getSortInfo ( Value $value ) : mixed
$value eZ\Publish\Core\FieldType\Value
return mixed

isEmptyValue() public method

Returns if the given $value is considered empty by the field type.
public isEmptyValue ( eZ\Publish\SPI\FieldType\Value $value ) : boolean
$value eZ\Publish\SPI\FieldType\Value
return boolean

isSearchable() public method

Returns whether the field type is searchable.
public isSearchable ( ) : boolean
return boolean

toHash() public method

Converts a $Value to a hash.
public toHash ( eZ\Publish\SPI\FieldType\Value $value ) : mixed
$value eZ\Publish\SPI\FieldType\Value
return mixed

validateFieldSettings() public method

See also: eZ\Publish\Core\FieldType\FieldType::validateFieldSettings()
public validateFieldSettings ( mixed $fieldSettings ) : eZ\Publish\SPI\FieldType\ValidationError[]
$fieldSettings mixed
return eZ\Publish\SPI\FieldType\ValidationError[]

Property Details

$settingsSchema protected_oe property

protected $settingsSchema