public function ResourceObjectData::getOmissions in Drupal 8
Same name and namespace in other branches
- 9 core/modules/jsonapi/src/JsonApiResource/ResourceObjectData.php \Drupal\jsonapi\JsonApiResource\ResourceObjectData::getOmissions()
- 10 core/modules/jsonapi/src/JsonApiResource/ResourceObjectData.php \Drupal\jsonapi\JsonApiResource\ResourceObjectData::getOmissions()
Gets only data to be omitted.
Return value
static
Overrides TopLevelDataInterface::getOmissions
File
- core/
modules/ jsonapi/ src/ JsonApiResource/ ResourceObjectData.php, line 61
Class
- ResourceObjectData
- Represents the primary data for individual and collection documents.
Namespace
Drupal\jsonapi\JsonApiResourceCode
public function getOmissions() {
$omitted_data = [];
foreach ($this->data as $resource_object) {
if ($resource_object instanceof EntityAccessDeniedHttpException) {
$omitted_data[] = $resource_object;
}
}
return new OmittedData($omitted_data);
}