public function ResourceObjectData::getAccessible in Drupal 8
Same name and namespace in other branches
- 9 core/modules/jsonapi/src/JsonApiResource/ResourceObjectData.php \Drupal\jsonapi\JsonApiResource\ResourceObjectData::getAccessible()
- 10 core/modules/jsonapi/src/JsonApiResource/ResourceObjectData.php \Drupal\jsonapi\JsonApiResource\ResourceObjectData::getAccessible()
Gets only data to be exposed.
Return value
static
1 call to ResourceObjectData::getAccessible()
- ResourceObjectData::getData in core/
modules/ jsonapi/ src/ JsonApiResource/ ResourceObjectData.php - Returns the data for the top-level data member of a JSON:API document.
File
- core/
modules/ jsonapi/ src/ JsonApiResource/ ResourceObjectData.php, line 46
Class
- ResourceObjectData
- Represents the primary data for individual and collection documents.
Namespace
Drupal\jsonapi\JsonApiResourceCode
public function getAccessible() {
$accessible_data = [];
foreach ($this->data as $resource_object) {
if (!$resource_object instanceof EntityAccessDeniedHttpException) {
$accessible_data[] = $resource_object;
}
}
return new static($accessible_data, $this->cardinality);
}