FieldItemListStubFactory
in package
The FieldItemListStubFactory class.
Table of Contents
Methods
- __construct() : mixed
- Constructs a new EntityStubFactory.
- create() : FieldItemListInterface
- Creates a field instance stub.
- createFieldItemDefinitionStub() : FieldDefinitionInterface
- Creates a field definition stub.
Methods
__construct()
Constructs a new EntityStubFactory.
public
__construct() : mixed
create()
Creates a field instance stub.
public
static create([string|null $name = null ][, array<string|int, mixed>|string|null $values = null ][, string|FieldDefinitionInterface|null $typeOrDefinition = null ][, TypedDataInterface $parent = null ][, bool|null $isBaseField = null ][, array<string|int, mixed>|null $mockMethods = null ]) : FieldItemListInterface
Parameters
- $name : string|null = null
-
The field name.
- $values : array<string|int, mixed>|string|null = null
-
The field values.
- $typeOrDefinition : string|FieldDefinitionInterface|null = null
-
A field type like 'string', 'integer', 'boolean'. Or a path to a field class like Drupal\Core\Field\Plugin\Field\FieldType\IntegerItem. Or a ready definition object to use. If null - will be created a stub with fallback ItemStubItem definition.
- $parent : TypedDataInterface = null
-
Parent item for attaching to the field.
- $isBaseField : bool|null = null
-
A flag to create a base field instance.
- $mockMethods : array<string|int, mixed>|null = null
-
A list of method to mock when creating the instance.
Return values
FieldItemListInterface —A field item list with items as stubs.
createFieldItemDefinitionStub()
Creates a field definition stub.
public
static createFieldItemDefinitionStub([string $class = null ][, array<string|int, mixed> $settings = null ][, bool $isBaseField = null ]) : FieldDefinitionInterface
Parameters
- $class : string = null
-
Field class.
- $settings : array<string|int, mixed> = null
-
Field settings.
- $isBaseField : bool = null
-
A flag to create a base field instance.
Return values
FieldDefinitionInterface —A field field definition stub.