You are here

public function ResourceFieldCollection::set in RESTful 7.2

Sets a field in the collection.

Parameters

string $key: The key of the field.

ResourceFieldInterface $field: The field to set.

Overrides ResourceFieldCollectionInterface::set

File

src/Plugin/resource/Field/ResourceFieldCollection.php, line 176
Contains \Drupal\restful\Plugin\resource\Field\ResourceFieldCollection.

Class

ResourceFieldCollection

Namespace

Drupal\restful\Plugin\resource\Field

Code

public function set($key, ResourceFieldInterface $field) {
  $this->fields[$key] = $field;
}