function ResourceTypeBuildEvent::disableField
Same name in other branches
- 9 core/modules/jsonapi/src/ResourceType/ResourceTypeBuildEvent.php \Drupal\jsonapi\ResourceType\ResourceTypeBuildEvent::disableField()
- 8.9.x core/modules/jsonapi/src/ResourceType/ResourceTypeBuildEvent.php \Drupal\jsonapi\ResourceType\ResourceTypeBuildEvent::disableField()
- 11.x core/modules/jsonapi/src/ResourceType/ResourceTypeBuildEvent.php \Drupal\jsonapi\ResourceType\ResourceTypeBuildEvent::disableField()
Disables the given field on the resource type to be built.
Parameters
\Drupal\jsonapi\ResourceType\ResourceTypeField $field: The field for which to set a public name.
File
-
core/
modules/ jsonapi/ src/ ResourceType/ ResourceTypeBuildEvent.php, line 145
Class
- ResourceTypeBuildEvent
- An event used to configure the construction of a JSON:API resource type.
Namespace
Drupal\jsonapi\ResourceTypeCode
public function disableField(ResourceTypeField $field) {
foreach ($this->fields as $index => $value) {
if ($field === $value) {
$this->fields[$index] = $value->disabled();
return;
}
}
}
Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.