function ResourceType::isFieldEnabled
Same name in other branches
- 9 core/modules/jsonapi/src/ResourceType/ResourceType.php \Drupal\jsonapi\ResourceType\ResourceType::isFieldEnabled()
- 8.9.x core/modules/jsonapi/src/ResourceType/ResourceType.php \Drupal\jsonapi\ResourceType\ResourceType::isFieldEnabled()
- 11.x core/modules/jsonapi/src/ResourceType/ResourceType.php \Drupal\jsonapi\ResourceType\ResourceType::isFieldEnabled()
Checks if a field is enabled or not.
This is only here so we can allow polymorphic implementations to take a greater control on the data model.
Parameters
string $field_name: The internal field name.
Return value
bool TRUE if the field exists and is enabled and should be considered as part of the data model. FALSE otherwise.
File
-
core/
modules/ jsonapi/ src/ ResourceType/ ResourceType.php, line 254
Class
- ResourceType
- Value object containing all metadata for a JSON:API resource type.
Namespace
Drupal\jsonapi\ResourceTypeCode
public function isFieldEnabled($field_name) {
return $this->hasField($field_name) && $this->fields[$field_name]
->isFieldEnabled();
}
Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.