Drupal Test Helpers module API documentation - release 1.3.1

EntityFieldManagerStub extends EntityFieldManager
in package

A stub of the Drupal's default EntityFieldManager class.

@package TestHelpers\DrupalServiceStubs

Table of Contents

Methods

stubAddFieldDefiniton()  : void
Adds a field definition for an entity type and a bundle.
stubClearFieldDefinitons()  : void
Clears stored field definitions for an entity type and.
stubSetBaseFieldDefinitons()  : void
Sets base field definitions.
stubSetFieldDefinitons()  : void
Sets field definitions for an entity type and a bundle.
buildBundleFieldDefinitions()  : mixed
{@inheritdoc}

Methods

stubAddFieldDefiniton()

Adds a field definition for an entity type and a bundle.

public stubAddFieldDefiniton(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.

stubClearFieldDefinitons()

Clears stored field definitions for an entity type and.

public stubClearFieldDefinitons(string $entityTypeId) : void
Parameters
$entityTypeId : string

The entity type id.

stubSetBaseFieldDefinitons()

Sets base field definitions.

public stubSetBaseFieldDefinitons(string $entityTypeId, mixed $baseFieldDefinitions) : void
Parameters
$entityTypeId : string

The entity type id.

$baseFieldDefinitions : mixed

The definitions.

stubSetFieldDefinitons()

Sets field definitions for an entity type and a bundle.

public stubSetFieldDefinitons(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>

        
On this page

Search results