PHP 클래스 eZ\Publish\Core\Repository\Values\ContentType\FieldType

또한 보기: eZ\Publish\API\Repository\FieldType
상속: implements eZ\Publish\API\Repository\FieldType
파일 보기 프로젝트 열기: ezsystems/ezpublish-kernel 1 사용 예제들

보호된 프로퍼티들

프로퍼티 타입 설명
$internalFieldType eZ\Publish\Core\FieldType\FieldType Holds internal FieldType object.

공개 메소드들

메소드 설명
__construct ( eZ\Publish\SPI\FieldType\FieldType $fieldType )
fieldSettingsFromHash ( array | hash | scalar | null $fieldSettingsHash ) : mixed Converts the given $fieldSettingsHash to field settings of the type.
fieldSettingsToHash ( mixed $fieldSettings ) : array | hash | scalar | null Converts the given $fieldSettings to a simple hash format.
fromHash ( mixed $hash ) : mixed Converts an $hash to the Value defined by the field type.
getEmptyValue ( ) : mixed 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 ( $value )
getSettingsSchema ( ) : mixed Returns a schema for the settings expected by the FieldType.
getValidatorConfigurationSchema ( ) : mixed Returns a schema for the validator configuration expected by the FieldType.
isEmptyValue ( mixed $value ) : boolean Returns if the given $value is considered empty by the field type.
isSearchable ( ) : boolean Indicates if the field type supports indexing and sort keys for searching.
isSingular ( ) : boolean Indicates if the field definition of this type can appear only once in the same ContentType.
onlyEmptyInstance ( ) : boolean Indicates if the field definition of this type can be added to a ContentType with Content instances.
toHash ( mixed $value ) : mixed Converts a Value to a hash.
validateFieldSettings ( mixed $fieldSettings ) : eZ\Publish\SPI\FieldType\ValidationError[] Validates the fieldSettings of a FieldDefinitionCreateStruct or FieldDefinitionUpdateStruct.
validateValidatorConfiguration ( mixed $validatorConfiguration ) : eZ\Publish\SPI\FieldType\ValidationError[] Validates the validatorConfiguration of a FieldDefinitionCreateStruct or FieldDefinitionUpdateStruct.
validateValue ( eZ\Publish\API\Repository\Values\ContentType\FieldDefinition $fieldDef, eZ\Publish\SPI\FieldType\Value $value ) : eZ\Publish\SPI\FieldType\ValidationError[] Validates a field value based on the validator configuration in the field definition.
validatorConfigurationFromHash ( array | hash | scalar | null $validatorConfigurationHash ) : mixed Converts the given $validatorConfigurationHash to a validator configuration of the type.
validatorConfigurationToHash ( mixed $validatorConfiguration ) : array | hash | scalar | null Converts the given $validatorConfiguration to a simple hash format.

메소드 상세

__construct() 공개 메소드

public __construct ( eZ\Publish\SPI\FieldType\FieldType $fieldType )
$fieldType eZ\Publish\SPI\FieldType\FieldType

fieldSettingsFromHash() 공개 메소드

This is the reverse operation of {@link fieldSettingsToHash()}.
public fieldSettingsFromHash ( array | hash | scalar | null $fieldSettingsHash ) : mixed
$fieldSettingsHash array | hash | scalar | null
리턴 mixed

fieldSettingsToHash() 공개 메소드

Converts the given $fieldSettings to a simple hash format.
public fieldSettingsToHash ( mixed $fieldSettings ) : array | hash | scalar | null
$fieldSettings mixed
리턴 array | hash | scalar | null

fromHash() 공개 메소드

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

getEmptyValue() 공개 메소드

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

getFieldTypeIdentifier() 공개 메소드

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

getName() 공개 메소드

public getName ( $value )

getSettingsSchema() 공개 메소드

Returns an arbitrary value, representing a schema for the settings of the FieldType. Explanation: There are no possible generic schemas for defining settings input, which is why no schema for the return value of this method is defined. It is up to the implementer to define and document a schema for the return value and document it. In addition, it is necessary that all consumers of this interface (e.g. Public API, REST API, GUIs, ...) provide plugin mechanisms to hook adapters for the specific FieldType into. These adapters then need to be either shipped with the FieldType or need to be implemented by a third party. If there is no adapter available for a specific FieldType, it will not be usable with the consumer.
public getSettingsSchema ( ) : mixed
리턴 mixed

getValidatorConfigurationSchema() 공개 메소드

Returns an arbitrary value, representing a schema for the validator configuration of the FieldType. Explanation: There are no possible generic schemas for defining settings input, which is why no schema for the return value of this method is defined. It is up to the implementer to define and document a schema for the return value and document it. In addition, it is necessary that all consumers of this interface (e.g. Public API, REST API, GUIs, ...) provide plugin mechanisms to hook adapters for the specific FieldType into. These adapters then need to be either shipped with the FieldType or need to be implemented by a third party. If there is no adapter available for a specific FieldType, it will not be usable with the consumer. Best practice: It is considered best practice to return a hash map, which contains rudimentary settings structures, like e.g. for the "ezstring" FieldType array( 'stringLength' => array( 'minStringLength' => array( 'type' => 'int', 'default' => 0, ), 'maxStringLength' => array( 'type' => 'int' 'default' => null, ) ), );

isEmptyValue() 공개 메소드

Usually, only the value returned by {@link getEmptyValue()} is considered empty but that is not always the case. Note: This function assumes that $value is valid so this function can only be used reliably on $values that came from the API, not from the user.
public isEmptyValue ( mixed $value ) : boolean
$value mixed
리턴 boolean

isSearchable() 공개 메소드

Indicates if the field type supports indexing and sort keys for searching.
public isSearchable ( ) : boolean
리턴 boolean

isSingular() 공개 메소드

Indicates if the field definition of this type can appear only once in the same ContentType.
public isSingular ( ) : boolean
리턴 boolean

onlyEmptyInstance() 공개 메소드

Indicates if the field definition of this type can be added to a ContentType with Content instances.
public onlyEmptyInstance ( ) : boolean
리턴 boolean

toHash() 공개 메소드

Converts a Value to a hash.
public toHash ( mixed $value ) : mixed
$value mixed
리턴 mixed

validateFieldSettings() 공개 메소드

This methods determines if the given $fieldSettings are structurally correct and comply to the settings schema as defined in FieldType.
public validateFieldSettings ( mixed $fieldSettings ) : eZ\Publish\SPI\FieldType\ValidationError[]
$fieldSettings mixed
리턴 eZ\Publish\SPI\FieldType\ValidationError[]

validateValidatorConfiguration() 공개 메소드

This methods determines if the given $validatorConfiguration is structurally correct and complies to the validator configuration schema as defined in FieldType.
public validateValidatorConfiguration ( mixed $validatorConfiguration ) : eZ\Publish\SPI\FieldType\ValidationError[]
$validatorConfiguration mixed
리턴 eZ\Publish\SPI\FieldType\ValidationError[]

validateValue() 공개 메소드

Validates a field value based on the validator configuration in the field definition.
public validateValue ( eZ\Publish\API\Repository\Values\ContentType\FieldDefinition $fieldDef, eZ\Publish\SPI\FieldType\Value $value ) : eZ\Publish\SPI\FieldType\ValidationError[]
$fieldDef eZ\Publish\API\Repository\Values\ContentType\FieldDefinition The field definition of the field
$value eZ\Publish\SPI\FieldType\Value The field value for which an action is performed
리턴 eZ\Publish\SPI\FieldType\ValidationError[]

validatorConfigurationFromHash() 공개 메소드

Converts the given $validatorConfigurationHash to a validator configuration of the type.
public validatorConfigurationFromHash ( array | hash | scalar | null $validatorConfigurationHash ) : mixed
$validatorConfigurationHash array | hash | scalar | null
리턴 mixed

validatorConfigurationToHash() 공개 메소드

Converts the given $validatorConfiguration to a simple hash format.
public validatorConfigurationToHash ( mixed $validatorConfiguration ) : array | hash | scalar | null
$validatorConfiguration mixed
리턴 array | hash | scalar | null

프로퍼티 상세

$internalFieldType 보호되어 있는 프로퍼티

Holds internal FieldType object.
protected FieldType,eZ\Publish\Core\FieldType $internalFieldType
리턴 eZ\Publish\Core\FieldType\FieldType