Exponential 5.x Kernel 7.5.40 Exponential New Stack (Symfony-based) Kernel — PHP Class Reference

Public Member Functions | Public Attributes | Private Member Functions | Private Attributes | List of all members
eZ\Bundle\EzPublishCoreBundle\Features\Context\FieldTypeContext Class Reference

Sentences for Fields. More...

Inheritance diagram for eZ\Bundle\EzPublishCoreBundle\Features\Context\FieldTypeContext:

## Public Member Functions
| __construct (Repository $repository, ContentTypeService $contentTypeService, ContentService $contentService, LocationService $locationService)
| @injectService $repository @ezpublish.api.repository @injectService $contentTypeService @ezpublish.api.service.content_type @injectService $contentService @ezpublish.api.service.content @injectService $locationService @ezpublish.api.service.location More...
| getFieldTypeInternalIdentifier ($identifier)
| Getter method for fieldtype internal identifier. More...
| getFieldValidator ($field)
| Getter method for the validator mappings. More...
| createField ($fieldType, $name=null, $required=false)
| Creates a fieldtype ans stores it for later use. More...
| addValueConstraint ($fieldType, $value, $constraint)
| Adds a validator to the stored field. More...
| createContent ($field, $value)
| Creates a content and publishes it. More...
| setFieldContentState ($stateFlag, $field=null, $value=null)
| Executes necessary operations to guarantee a given state, recursive function that calls it self to make sure prerequisites are met. More...
| getFieldContentState ()
| getThisContentTypeName ($language=self::DEFAULT_LANGUAGE)
| Getter method for the name of the stored contenttype. More...
| getThisContentName ($language=self::DEFAULT_LANGUAGE)
| Getter method for the name of the stored content. More...
| getThisFieldTypeName ($language=self::DEFAULT_LANGUAGE)
| Getter method for the name of the stored fieldtype. More...
| getThisFieldTypeIdentifier ()
| Getter method for the identifier of the stored fieldtype. More...
| getThisContentId ()
| Get the content id for the published content. More...
| createContentTypeWithFieldType ($fieldType, $name=null)
| @Given a Content Type with an :fieldType field exists @Given a Content Type with an :fieldType with field definition name :name exists More...
| createContentTypeWithRequiredFieldType ($fieldType, $name=null)
| @Given a Content Type with a required :fieldType field exists @Given a Content Type with a required :fieldType with field definition name :name exists More...
| createContentOfThisType ($field=null, $value=null)
| @Given a Content of this type exists @Given a Content of this type exists with :field Field Value set to :value More...
| createContentOfThisTypeWithProperties ($fieldType, TableNode $properties, $name=null)
| @Given a Content Type with an :fieldType field exists with Properties: @Given a Content Type with an :fieldType field with name :name exists with Properties: More...

## Public Attributes
const | FIELD_TYPE_NOT_CREATED = -1
| Defines the state of the Construction object, if it's not published, partialy or completely published. More...
const | FIELD_TYPE_CREATED = 0
const | CONTENT_TYPE_CREATED = 1
const | FIELD_TYPE_ASSOCIATED = 2
const | CONTENT_TYPE_PUBLISHED = 3
const | CONTENT_PUBLISHED = 4
const | DEFAULT_LANGUAGE = 'eng-GB'
| Default language. More...

## Private Member Functions
| createAndPublishContent ($field, $value)
| Creates and publishes the content with a given field and based on the internal ContentType. More...
| associateFieldToContentType ()
| Associates the stored fieldtype to the stored contenttype. More...
| publishContentType ()
| Publishes the stored contenttype. More...
| createContentType ()
| Creates an instance of a contenttype and stores it for later publishing. More...
| getActualFieldPosition ()
| Getter method for the position of the field, relative to other possible fields. More...

## Private Attributes
| $fieldConstructionObject
| $fieldTypeInternalIdentifier
| $validatorMappings
| $defaultValues
| $contentTypeService
| $contentService
| $locationService

## Detailed Description

Sentences for Fields.

Definition at line 20 of file FieldTypeContext.php.

## Constructor & Destructor Documentation

## ◆ __construct()

eZ\Bundle\EzPublishCoreBundle\Features\Context\FieldTypeContext::__construct | ( | Repository | $repository,
|  | ContentTypeService | $contentTypeService,
|  | ContentService | $contentService,
|  | LocationService | $locationService
| ) |  |

@injectService $repository @ezpublish.api.repository @injectService $contentTypeService @ezpublish.api.service.content_type @injectService $contentService @ezpublish.api.service.content @injectService $locationService @ezpublish.api.service.location

Definition at line 80 of file FieldTypeContext.php.

References eZ\Bundle\EzPublishCoreBundle\Features\Context\FieldTypeContext\$contentService, eZ\Bundle\EzPublishCoreBundle\Features\Context\FieldTypeContext\$contentTypeService, and eZ\Bundle\EzPublishCoreBundle\Features\Context\FieldTypeContext\$locationService.

## Member Function Documentation

## ◆ addValueConstraint()

eZ\Bundle\EzPublishCoreBundle\Features\Context\FieldTypeContext::addValueConstraint | ( |  | $fieldType,
|  |  | $value,
|  |  | $constraint
| ) |  |

Adds a validator to the stored field.

Parameters

  string | $fieldType | Type of the field
  string | $value | Value of the constraint
  string | $constraint | Constraint name

Definition at line 146 of file FieldTypeContext.php.

References eZ\Bundle\EzPublishCoreBundle\Features\Context\FieldTypeContext\getFieldValidator().

Referenced by eZ\Bundle\EzPublishCoreBundle\Features\Context\FieldTypeContext\createContentOfThisTypeWithProperties().

## ◆ associateFieldToContentType()

eZ\Bundle\EzPublishCoreBundle\Features\Context\FieldTypeContext::associateFieldToContentType | ( |  | ) |
| private

Associates the stored fieldtype to the stored contenttype.

Definition at line 244 of file FieldTypeContext.php.

References eZ\Bundle\EzPublishCoreBundle\Features\Context\FieldTypeContext\FIELD_TYPE_ASSOCIATED.

Referenced by eZ\Bundle\EzPublishCoreBundle\Features\Context\FieldTypeContext\setFieldContentState().

## ◆ createAndPublishContent()

eZ\Bundle\EzPublishCoreBundle\Features\Context\FieldTypeContext::createAndPublishContent | ( |  | $field,
|  |  | $value
| ) |  |
| private

Creates and publishes the content with a given field and based on the internal ContentType.

Parameters

  string | The field name
  mixed | The field value

Definition at line 222 of file FieldTypeContext.php.

References eZ\Bundle\EzPublishCoreBundle\Features\Context\FieldTypeContext\CONTENT_PUBLISHED, and eZ\Bundle\EzPublishCoreBundle\Features\Context\FieldTypeContext\DEFAULT_LANGUAGE.

Referenced by eZ\Bundle\EzPublishCoreBundle\Features\Context\FieldTypeContext\setFieldContentState().

## ◆ createContent()

eZ\Bundle\EzPublishCoreBundle\Features\Context\FieldTypeContext::createContent | ( |  | $field,
|  |  | $value
| ) |  |

Creates a content and publishes it.

Parameters

  string | $field | Name of the field
  mixed | $value | Value of the field

Definition at line 167 of file FieldTypeContext.php.

References eZ\Bundle\EzPublishCoreBundle\Features\Context\FieldTypeContext\setFieldContentState().

Referenced by eZ\Bundle\EzPublishCoreBundle\Features\Context\FieldTypeContext\createContentOfThisType().

## ◆ createContentOfThisType()

eZ\Bundle\EzPublishCoreBundle\Features\Context\FieldTypeContext::createContentOfThisType | ( |  | $field = `null`,
|  |  | $value = `null`
| ) |  |

@Given a Content of this type exists @Given a Content of this type exists with :field Field Value set to :value

Creates a Content with the previously defined ContentType.

Definition at line 381 of file FieldTypeContext.php.

References eZ\Bundle\EzPublishCoreBundle\Features\Context\FieldTypeContext\createContent().

## ◆ createContentOfThisTypeWithProperties()

eZ\Bundle\EzPublishCoreBundle\Features\Context\FieldTypeContext::createContentOfThisTypeWithProperties | ( |  | $fieldType,
|  | TableNode | $properties,
|  |  | $name = `null`
| ) |  |

@Given a Content Type with an :fieldType field exists with Properties: @Given a Content Type with an :fieldType field with name :name exists with Properties:

Definition at line 390 of file FieldTypeContext.php.

References eZ\Bundle\EzPublishCoreBundle\Features\Context\FieldTypeContext\addValueConstraint(), and eZ\Bundle\EzPublishCoreBundle\Features\Context\FieldTypeContext\createField().

## ◆ createContentType()

eZ\Bundle\EzPublishCoreBundle\Features\Context\FieldTypeContext::createContentType | ( |  | ) |
| private

Creates an instance of a contenttype and stores it for later publishing.

Definition at line 328 of file FieldTypeContext.php.

References eZ\Bundle\EzPublishCoreBundle\Features\Context\FieldTypeContext\CONTENT_TYPE_CREATED, and eZ\Bundle\EzPublishCoreBundle\Features\Context\FieldTypeContext\DEFAULT_LANGUAGE.

Referenced by eZ\Bundle\EzPublishCoreBundle\Features\Context\FieldTypeContext\setFieldContentState().

## ◆ createContentTypeWithFieldType()

eZ\Bundle\EzPublishCoreBundle\Features\Context\FieldTypeContext::createContentTypeWithFieldType | ( |  | $fieldType,
|  |  | $name = `null`
| ) |  |

@Given a Content Type with an :fieldType field exists @Given a Content Type with an :fieldType with field definition name :name exists

Creates a ContentType with only the desired FieldType.

Definition at line 359 of file FieldTypeContext.php.

References eZ\Bundle\EzPublishCoreBundle\Features\Context\FieldTypeContext\createField().

## ◆ createContentTypeWithRequiredFieldType()

eZ\Bundle\EzPublishCoreBundle\Features\Context\FieldTypeContext::createContentTypeWithRequiredFieldType | ( |  | $fieldType,
|  |  | $name = `null`
| ) |  |

@Given a Content Type with a required :fieldType field exists @Given a Content Type with a required :fieldType with field definition name :name exists

Creates a ContentType with only the desired FieldType.

Definition at line 370 of file FieldTypeContext.php.

References eZ\Bundle\EzPublishCoreBundle\Features\Context\FieldTypeContext\createField().

## ◆ createField()

eZ\Bundle\EzPublishCoreBundle\Features\Context\FieldTypeContext::createField | ( |  | $fieldType,
|  |  | $name = `null`,
|  |  | $required = `false`
| ) |  |

Creates a fieldtype ans stores it for later use.

Parameters

  string | $fieldType | Type of the field
  string | $name | Name of the field, optional, if not specified $fieldType is used
  bool | $required | True if the is the field required, optional

Definition at line 123 of file FieldTypeContext.php.

References eZ\Bundle\EzPublishCoreBundle\Features\Context\FieldTypeContext\FIELD_TYPE_CREATED, and eZ\Bundle\EzPublishCoreBundle\Features\Context\FieldTypeContext\getActualFieldPosition().

Referenced by eZ\Bundle\EzPublishCoreBundle\Features\Context\FieldTypeContext\createContentOfThisTypeWithProperties(), eZ\Bundle\EzPublishCoreBundle\Features\Context\FieldTypeContext\createContentTypeWithFieldType(), and eZ\Bundle\EzPublishCoreBundle\Features\Context\FieldTypeContext\createContentTypeWithRequiredFieldType().

## ◆ getActualFieldPosition()

eZ\Bundle\EzPublishCoreBundle\Features\Context\FieldTypeContext::getActualFieldPosition | ( |  | ) |
| private

Getter method for the position of the field, relative to other possible fields.

Definition at line 344 of file FieldTypeContext.php.

Referenced by eZ\Bundle\EzPublishCoreBundle\Features\Context\FieldTypeContext\createField().

## ◆ getFieldContentState()

eZ\Bundle\EzPublishCoreBundle\Features\Context\FieldTypeContext::getFieldContentState | ( |  | ) |

Definition at line 210 of file FieldTypeContext.php.

## ◆ getFieldTypeInternalIdentifier()

eZ\Bundle\EzPublishCoreBundle\Features\Context\FieldTypeContext::getFieldTypeInternalIdentifier | ( |  | $identifier | ) |

Getter method for fieldtype internal identifier.

Parameters

  string | $identifier | Identifier of the field

Returns
  string internal Identifier of the field

Definition at line 99 of file FieldTypeContext.php.

## ◆ getFieldValidator()

eZ\Bundle\EzPublishCoreBundle\Features\Context\FieldTypeContext::getFieldValidator | ( |  | $field | ) |

Getter method for the validator mappings.

Parameters

  string | $field | Field name

Returns
  string field Validator name

Definition at line 111 of file FieldTypeContext.php.

Referenced by eZ\Bundle\EzPublishCoreBundle\Features\Context\FieldTypeContext\addValueConstraint().

## ◆ getThisContentId()

eZ\Bundle\EzPublishCoreBundle\Features\Context\FieldTypeContext::getThisContentId | ( |  | ) |

Get the content id for the published content.

Returns
  int

Definition at line 320 of file FieldTypeContext.php.

## ◆ getThisContentName()

eZ\Bundle\EzPublishCoreBundle\Features\Context\FieldTypeContext::getThisContentName | ( |  | $language = `self::DEFAULT_LANGUAGE` | ) |

Getter method for the name of the stored content.

Parameters

  string | $language | Language of the name

Returns
  string Name of the contenttype

Definition at line 288 of file FieldTypeContext.php.

## ◆ getThisContentTypeName()

eZ\Bundle\EzPublishCoreBundle\Features\Context\FieldTypeContext::getThisContentTypeName | ( |  | $language = `self::DEFAULT_LANGUAGE` | ) |

Getter method for the name of the stored contenttype.

Parameters

  string | $language | Language of the name

Returns
  string Name of the contenttype

Definition at line 276 of file FieldTypeContext.php.

## ◆ getThisFieldTypeIdentifier()

eZ\Bundle\EzPublishCoreBundle\Features\Context\FieldTypeContext::getThisFieldTypeIdentifier | ( |  | ) |

Getter method for the identifier of the stored fieldtype.

Returns
  string idenfier of the fieldtype

Definition at line 310 of file FieldTypeContext.php.

## ◆ getThisFieldTypeName()

eZ\Bundle\EzPublishCoreBundle\Features\Context\FieldTypeContext::getThisFieldTypeName | ( |  | $language = `self::DEFAULT_LANGUAGE` | ) |

Getter method for the name of the stored fieldtype.

Parameters

  string | $language | Language of the name

Returns
  string Name of the fieldtype

Definition at line 300 of file FieldTypeContext.php.

## ◆ publishContentType()

eZ\Bundle\EzPublishCoreBundle\Features\Context\FieldTypeContext::publishContentType | ( |  | ) |
| private

Publishes the stored contenttype.

Definition at line 254 of file FieldTypeContext.php.

References eZ\Bundle\EzPublishCoreBundle\Features\Context\FieldTypeContext\CONTENT_TYPE_PUBLISHED.

Referenced by eZ\Bundle\EzPublishCoreBundle\Features\Context\FieldTypeContext\setFieldContentState().

## ◆ setFieldContentState()

eZ\Bundle\EzPublishCoreBundle\Features\Context\FieldTypeContext::setFieldContentState | ( |  | $stateFlag,
|  |  | $field = `null`,
|  |  | $value = `null`
| ) |  |

Executes necessary operations to guarantee a given state, recursive function that calls it self to make sure prerequisites are met.

Parameters

  int | $stateFlag | Desired state, only predefined constants accepted
  string | $field | Name of the field, optional
  mixed | $value | Value of the field, optional

Definition at line 180 of file FieldTypeContext.php.

References eZ\Bundle\EzPublishCoreBundle\Features\Context\FieldTypeContext\associateFieldToContentType(), eZ\Bundle\EzPublishCoreBundle\Features\Context\FieldTypeContext\CONTENT_PUBLISHED, eZ\Bundle\EzPublishCoreBundle\Features\Context\FieldTypeContext\CONTENT_TYPE_CREATED, eZ\Bundle\EzPublishCoreBundle\Features\Context\FieldTypeContext\CONTENT_TYPE_PUBLISHED, eZ\Bundle\EzPublishCoreBundle\Features\Context\FieldTypeContext\createAndPublishContent(), eZ\Bundle\EzPublishCoreBundle\Features\Context\FieldTypeContext\createContentType(), eZ\Bundle\EzPublishCoreBundle\Features\Context\FieldTypeContext\FIELD_TYPE_ASSOCIATED, eZ\Bundle\EzPublishCoreBundle\Features\Context\FieldTypeContext\FIELD_TYPE_NOT_CREATED, and eZ\Bundle\EzPublishCoreBundle\Features\Context\FieldTypeContext\publishContentType().

Referenced by eZ\Bundle\EzPublishCoreBundle\Features\Context\FieldTypeContext\createContent().

## Member Data Documentation

## ◆ $contentService

eZ\Bundle\EzPublishCoreBundle\Features\Context\FieldTypeContext::$contentService
| private

Definition at line 69 of file FieldTypeContext.php.

Referenced by eZ\Bundle\EzPublishCoreBundle\Features\Context\FieldTypeContext\__construct().

## ◆ $contentTypeService

eZ\Bundle\EzPublishCoreBundle\Features\Context\FieldTypeContext::$contentTypeService
| private

Definition at line 66 of file FieldTypeContext.php.

Referenced by eZ\Bundle\EzPublishCoreBundle\Features\Context\FieldTypeContext\__construct().

## ◆ $defaultValues

eZ\Bundle\EzPublishCoreBundle\Features\Context\FieldTypeContext::$defaultValues
| private

Initial value:
= [
'integer' => 1,
]

Definition at line 61 of file FieldTypeContext.php.

## ◆ $fieldConstructionObject

eZ\Bundle\EzPublishCoreBundle\Features\Context\FieldTypeContext::$fieldConstructionObject
| private

Initial value:
= [
'contentType' => null,
'fieldType' => null,
'content' => null,
'objectState' => self::FIELD_TYPE_NOT_CREATED,
]
eZ\Bundle\EzPublishCoreBundle\Features\Context\FieldTypeContext\FIELD_TYPE_NOT_CREATED
const FIELD_TYPE_NOT_CREATED
Defines the state of the Construction object, if it's not published, partialy or completely published...
Definition: FieldTypeContext.php:27

Definition at line 43 of file FieldTypeContext.php.

## ◆ $fieldTypeInternalIdentifier

eZ\Bundle\EzPublishCoreBundle\Features\Context\FieldTypeContext::$fieldTypeInternalIdentifier
| private

Initial value:
= [
'integer' => 'ezinteger',
]

Definition at line 51 of file FieldTypeContext.php.

## ◆ $locationService

eZ\Bundle\EzPublishCoreBundle\Features\Context\FieldTypeContext::$locationService
| private

Definition at line 72 of file FieldTypeContext.php.

Referenced by eZ\Bundle\EzPublishCoreBundle\Features\Context\FieldTypeContext\__construct().

## ◆ $validatorMappings

eZ\Bundle\EzPublishCoreBundle\Features\Context\FieldTypeContext::$validatorMappings
| private

Initial value:
= [
'integer' => 'IntegerValue',
]

Definition at line 56 of file FieldTypeContext.php.

## ◆ CONTENT_PUBLISHED

const eZ\Bundle\EzPublishCoreBundle\Features\Context\FieldTypeContext::CONTENT_PUBLISHED = 4

Definition at line 32 of file FieldTypeContext.php.

Referenced by eZ\Bundle\EzPublishCoreBundle\Features\Context\FieldTypeContext\createAndPublishContent(), and eZ\Bundle\EzPublishCoreBundle\Features\Context\FieldTypeContext\setFieldContentState().

## ◆ CONTENT_TYPE_CREATED

const eZ\Bundle\EzPublishCoreBundle\Features\Context\FieldTypeContext::CONTENT_TYPE_CREATED = 1

Definition at line 29 of file FieldTypeContext.php.

Referenced by eZ\Bundle\EzPublishCoreBundle\Features\Context\FieldTypeContext\createContentType(), and eZ\Bundle\EzPublishCoreBundle\Features\Context\FieldTypeContext\setFieldContentState().

## ◆ CONTENT_TYPE_PUBLISHED

const eZ\Bundle\EzPublishCoreBundle\Features\Context\FieldTypeContext::CONTENT_TYPE_PUBLISHED = 3

Definition at line 31 of file FieldTypeContext.php.

Referenced by eZ\Bundle\EzPublishCoreBundle\Features\Context\FieldTypeContext\publishContentType(), and eZ\Bundle\EzPublishCoreBundle\Features\Context\FieldTypeContext\setFieldContentState().

## ◆ DEFAULT_LANGUAGE

const eZ\Bundle\EzPublishCoreBundle\Features\Context\FieldTypeContext::DEFAULT_LANGUAGE = 'eng-GB'

Default language.

Definition at line 37 of file FieldTypeContext.php.

Referenced by eZ\Bundle\EzPublishCoreBundle\Features\Context\FieldTypeContext\createAndPublishContent(), and eZ\Bundle\EzPublishCoreBundle\Features\Context\FieldTypeContext\createContentType().

## ◆ FIELD_TYPE_ASSOCIATED

const eZ\Bundle\EzPublishCoreBundle\Features\Context\FieldTypeContext::FIELD_TYPE_ASSOCIATED = 2

Definition at line 30 of file FieldTypeContext.php.

Referenced by eZ\Bundle\EzPublishCoreBundle\Features\Context\FieldTypeContext\associateFieldToContentType(), and eZ\Bundle\EzPublishCoreBundle\Features\Context\FieldTypeContext\setFieldContentState().

## ◆ FIELD_TYPE_CREATED

const eZ\Bundle\EzPublishCoreBundle\Features\Context\FieldTypeContext::FIELD_TYPE_CREATED = 0

Definition at line 28 of file FieldTypeContext.php.

Referenced by eZ\Bundle\EzPublishCoreBundle\Features\Context\FieldTypeContext\createField().

## ◆ FIELD_TYPE_NOT_CREATED

const eZ\Bundle\EzPublishCoreBundle\Features\Context\FieldTypeContext::FIELD_TYPE_NOT_CREATED = -1

Defines the state of the Construction object, if it's not published, partialy or completely published.

Definition at line 27 of file FieldTypeContext.php.

Referenced by eZ\Bundle\EzPublishCoreBundle\Features\Context\FieldTypeContext\setFieldContentState().

The documentation for this class was generated from the following file:

- FieldTypeContext.php

Copyright © 1998 – 2026 7x. All rights reserved. Licensed under the GNU GPLv2+.