EntityFieldManagerStub
extends EntityFieldManager
in package
A stub of the Drupal's default EntityFieldManager class.
@package TestHelpers\DrupalServiceStubs
Table of Contents
Methods
- stubAddFieldDefinition() : void
- Adds a field definition for an entity type and a bundle.
- stubClearFieldDefinitions() : void
- Clears stored field definitions for an entity type and.
- stubSetBaseFieldDefinitions() : void
- Sets base field definitions.
- stubSetFieldDefinitions() : void
- Sets field definitions for an entity type and a bundle.
- buildBundleFieldDefinitions() : mixed
- {@inheritdoc}
Methods
stubAddFieldDefinition()
Adds a field definition for an entity type and a bundle.
public
stubAddFieldDefinition(string $entityTypeId, string $bundle, string $fieldName, FieldDefinitionInterface $fieldDefinition[, string $langcode = NULL ]) : void
Parameters
- $entityTypeId : string
-
The entity type id.
- $bundle : string
-
The bundle.
- $fieldName : string
-
The field name.
- $fieldDefinition : FieldDefinitionInterface
-
The definitions.
- $langcode : string = NULL
-
The langcode, gets the current language if NULL.
stubClearFieldDefinitions()
Clears stored field definitions for an entity type and.
public
stubClearFieldDefinitions(string $entityTypeId) : void
Parameters
- $entityTypeId : string
-
The entity type id.
stubSetBaseFieldDefinitions()
Sets base field definitions.
public
stubSetBaseFieldDefinitions(string $entityTypeId, mixed $baseFieldDefinitions) : void
Parameters
- $entityTypeId : string
-
The entity type id.
- $baseFieldDefinitions : mixed
-
The definitions.
stubSetFieldDefinitions()
Sets field definitions for an entity type and a bundle.
public
stubSetFieldDefinitions(string $entityTypeId, string $bundle, array<string|int, FieldDefinitionInterface> $fieldDefinitions[, string $langcode = NULL ]) : void
Parameters
- $entityTypeId : string
-
The entity type id.
- $bundle : string
-
The bundle.
- $fieldDefinitions : array<string|int, FieldDefinitionInterface>
-
The definitions.
- $langcode : string = NULL
-
The langcode, gets the current language if NULL.
buildBundleFieldDefinitions()
{@inheritdoc}
protected
buildBundleFieldDefinitions(mixed $entity_type_id, mixed $bundle, array<string|int, mixed> $base_field_definitions) : mixed
Parameters
- $entity_type_id : mixed
- $bundle : mixed
- $base_field_definitions : array<string|int, mixed>