public function ResourceFieldEntity::addMetadata in RESTful 7.2
Add metadata to the field.
This is a general purpose metadata storage for the field to store other things that are not specifically the field value.
You can pass in a namespaced $key using a : as a delimiter. Namespaces will result in nested arrays. That means that addMetadata('foo:bar:baz', 'oof') will result in metadata['foo']['bar']['baz'] = 'oof'.
Parameters
string $key: The metadata item identifier.
mixed $value: The metadata value.
Overrides ResourceFieldInterface::addMetadata
1 call to ResourceFieldEntity::addMetadata()
- ResourceFieldEntity::singleValue in src/
Plugin/ resource/ Field/ ResourceFieldEntity.php - Returns the value for the current single field.
File
- src/
Plugin/ resource/ Field/ ResourceFieldEntity.php, line 596 - Contains \Drupal\restful\Plugin\resource\Field\ResourceFieldEntity
Class
- ResourceFieldEntity
- Class ResourceFieldEntity.
Namespace
Drupal\restful\Plugin\resource\FieldCode
public function addMetadata($key, $value) {
$this->decorated
->addMetadata($key, $value);
}