You are here

public function ConfigurableResourceType::isFieldEnabled in JSON:API Extras 8

Same name and namespace in other branches
  1. 8.2 src/ResourceType/ConfigurableResourceType.php \Drupal\jsonapi_extras\ResourceType\ConfigurableResourceType::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.

Overrides ResourceType::isFieldEnabled

File

src/ResourceType/ConfigurableResourceType.php, line 98

Class

ConfigurableResourceType
Defines a configurable resource type.

Namespace

Drupal\jsonapi_extras\ResourceType

Code

public function isFieldEnabled($field_name) {
  $resource_field = $this
    ->getResourceFieldConfiguration($field_name);
  return $resource_field ? empty($resource_field['disabled']) : parent::isFieldEnabled($field_name);
}