public function ResourceType::isFieldEnabled in JSON:API 8.2
Same name and namespace in other branches
- 8 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
- src/
ResourceType/ ResourceType.php, line 218
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) && !in_array($field_name, $this->disabledFields, TRUE);
}