PHP Class eZ\Bundle\EzPublishCoreBundle\Features\Context\FieldTypeContext

Inheritance: implements Behat\Behat\Context\Context, use trait EzSystems\PlatformBehatBundle\Context\RepositoryContext
Mostra file Open project: ezsystems/ezpublish-kernel

Public Methods

Method Description
__construct ( eZ\Publish\API\Repository\Repository $repository, eZ\Publish\API\Repository\ContentTypeService $contentTypeService, eZ\Publish\API\Repository\ContentService $contentService, eZ\Publish\API\Repository\LocationService $locationService )
addValueConstraint ( string $fieldType, string $value, string $constraint ) Adds a validator to the stored field.
createContent ( string $field, mixed $value ) Creates a content and publishes it.
createContentOfThisType ( $field = null, $value = null )
createContentOfThisTypeWithProperties ( $fieldType, Behat\Gherkin\Node\TableNode $properties, $name = null )
createContentTypeWithFieldType ( $fieldType, $name = null )
createContentTypeWithRequiredFieldType ( $fieldType, $name = null )
createField ( string $fieldType, string $name = null, boolean $required = false ) Creates a fieldtype ans stores it for later use.
getFieldContentState ( )
getFieldTypeInternalIdentifier ( string $identifier ) : string Getter method for fieldtype internal identifier.
getFieldValidator ( string $field ) : string Getter method for the validator mappings.
getThisContentId ( ) : integer Get the content id for the published content.
getThisContentName ( string $language = self::DEFAULT_LANGUAGE ) : string Getter method for the name of the stored content.
getThisContentTypeName ( string $language = self::DEFAULT_LANGUAGE ) : string Getter method for the name of the stored contenttype.
getThisFieldTypeIdentifier ( ) : string Getter method for the identifier of the stored fieldtype.
getThisFieldTypeName ( string $language = self::DEFAULT_LANGUAGE ) : string Getter method for the name of the stored fieldtype.
setFieldContentState ( integer $stateFlag, string $field = null, mixed $value = null ) Executes necessary operations to guarantee a given state, recursive function that calls it self to make sure prerequisites are met.

Private Methods

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

Method Details

__construct() public method

public __construct ( eZ\Publish\API\Repository\Repository $repository, eZ\Publish\API\Repository\ContentTypeService $contentTypeService, eZ\Publish\API\Repository\ContentService $contentService, eZ\Publish\API\Repository\LocationService $locationService )
$repository eZ\Publish\API\Repository\Repository
$contentTypeService eZ\Publish\API\Repository\ContentTypeService
$contentService eZ\Publish\API\Repository\ContentService
$locationService eZ\Publish\API\Repository\LocationService

addValueConstraint() public method

Adds a validator to the stored field.
public addValueConstraint ( string $fieldType, string $value, string $constraint )
$fieldType string Type of the field
$value string Value of the constraint
$constraint string Constraint name

createContent() public method

Creates a content and publishes it.
public createContent ( string $field, mixed $value )
$field string Name of the field
$value mixed Value of the field

createContentOfThisType() public method

public createContentOfThisType ( $field = null, $value = null )

createContentOfThisTypeWithProperties() public method

public createContentOfThisTypeWithProperties ( $fieldType, Behat\Gherkin\Node\TableNode $properties, $name = null )
$properties Behat\Gherkin\Node\TableNode

createContentTypeWithFieldType() public method

public createContentTypeWithFieldType ( $fieldType, $name = null )

createContentTypeWithRequiredFieldType() public method

public createContentTypeWithRequiredFieldType ( $fieldType, $name = null )

createField() public method

Creates a fieldtype ans stores it for later use.
public createField ( string $fieldType, string $name = null, boolean $required = false )
$fieldType string Type of the field
$name string Name of the field, optional, if not specified $fieldType is used
$required boolean True if the is the field required, optional

getFieldContentState() public method

getFieldTypeInternalIdentifier() public method

Getter method for fieldtype internal identifier.
public getFieldTypeInternalIdentifier ( string $identifier ) : string
$identifier string Identifier of the field
return string internal Identifier of the field

getFieldValidator() public method

Getter method for the validator mappings.
public getFieldValidator ( string $field ) : string
$field string Field name
return string field Validator name

getThisContentId() public method

Get the content id for the published content.
public getThisContentId ( ) : integer
return integer

getThisContentName() public method

Getter method for the name of the stored content.
public getThisContentName ( string $language = self::DEFAULT_LANGUAGE ) : string
$language string Language of the name
return string Name of the contenttype

getThisContentTypeName() public method

Getter method for the name of the stored contenttype.
public getThisContentTypeName ( string $language = self::DEFAULT_LANGUAGE ) : string
$language string Language of the name
return string Name of the contenttype

getThisFieldTypeIdentifier() public method

Getter method for the identifier of the stored fieldtype.
public getThisFieldTypeIdentifier ( ) : string
return string idenfier of the fieldtype

getThisFieldTypeName() public method

Getter method for the name of the stored fieldtype.
public getThisFieldTypeName ( string $language = self::DEFAULT_LANGUAGE ) : string
$language string Language of the name
return string Name of the fieldtype

setFieldContentState() public method

Executes necessary operations to guarantee a given state, recursive function that calls it self to make sure prerequisites are met.
public setFieldContentState ( integer $stateFlag, string $field = null, mixed $value = null )
$stateFlag integer Desired state, only predefined constants accepted
$field string Name of the field, optional
$value mixed Value of the field, optional