public function FieldTestItem::__construct in Zircon Profile 8.0
Same name and namespace in other branches
- 8 core/modules/system/tests/modules/entity_test/src/Plugin/Field/FieldType/FieldTestItem.php \Drupal\entity_test\Plugin\Field\FieldType\FieldTestItem::__construct()
Constructs a TypedData object given its definition and context.
@todo When \Drupal\Core\Config\TypedConfigManager has been fixed to use class-based definitions, type-hint $definition to DataDefinitionInterface. https://www.drupal.org/node/1928868
Parameters
\Drupal\Core\TypedData\DataDefinitionInterface $definition: The data definition.
string $name: (optional) The name of the created property, or NULL if it is the root of a typed data tree. Defaults to NULL.
\Drupal\Core\TypedData\TypedDataInterface $parent: (optional) The parent object of the data property, or NULL if it is the root of a typed data tree. Defaults to NULL.
Overrides FieldItemBase::__construct
See also
\Drupal\Core\TypedData\TypedDataManager::create()
File
- core/
modules/ system/ tests/ modules/ entity_test/ src/ Plugin/ Field/ FieldType/ FieldTestItem.php, line 67 - Contains \Drupal\entity_test\Plugin\Field\FieldType\FieldTestItem.
Class
- FieldTestItem
- Defines the 'field_test' entity field type.
Namespace
Drupal\entity_test\Plugin\Field\FieldTypeCode
public function __construct(DataDefinitionInterface $definition, $name = NULL, TypedDataInterface $parent = NULL) {
parent::__construct($definition, $name, $parent);
$name = $this
->getFieldDefinition()
->getName();
static::$counter[$name] = 0;
}