function ResourceType::isInternal
Same name in other branches
- 9 core/modules/jsonapi/src/ResourceType/ResourceType.php \Drupal\jsonapi\ResourceType\ResourceType::isInternal()
- 8.9.x core/modules/jsonapi/src/ResourceType/ResourceType.php \Drupal\jsonapi\ResourceType\ResourceType::isInternal()
- 11.x core/modules/jsonapi/src/ResourceType/ResourceType.php \Drupal\jsonapi\ResourceType\ResourceType::isInternal()
Whether this resource type is internal.
This must not be used as an access control mechanism.
Internal resource types are not available via the HTTP API. They have no routes and cannot be used for filtering or sorting. They cannot be included in the response using the `include` query parameter.
However, relationship fields on public resources *will include* a resource identifier for the referenced internal resource.
This method exists to remove data that should not logically be exposed by the HTTP API. For example, read-only data from an internal resource might be embedded in a public resource using computed fields. Therefore, including the internal resource as a relationship with distinct routes might unnecessarily expose internal implementation details.
Return value
bool TRUE if the resource type is internal. FALSE otherwise.
File
-
core/
modules/ jsonapi/ src/ ResourceType/ ResourceType.php, line 290
Class
- ResourceType
- Value object containing all metadata for a JSON:API resource type.
Namespace
Drupal\jsonapi\ResourceTypeCode
public function isInternal() {
return $this->internal;
}
Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.