You are here

public function ResourceFieldCollection::setContext in RESTful 7.2

Sets a context for the group of fields.

Parameters

string $context_id: The context identifier. Ex: 'cache_fragments'.

ArrayCollection $context: The context.

Overrides ResourceFieldCollectionInterface::setContext

File

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

Class

ResourceFieldCollection

Namespace

Drupal\restful\Plugin\resource\Field

Code

public function setContext($context_id, ArrayCollection $context) {
  $this->context[$context_id] = $context;
}