public function ResourceObjectData::getOmissions in Drupal 10
Same name and namespace in other branches
- 8 core/modules/jsonapi/src/JsonApiResource/ResourceObjectData.php \Drupal\jsonapi\JsonApiResource\ResourceObjectData::getOmissions()
- 9 core/modules/jsonapi/src/JsonApiResource/ResourceObjectData.php \Drupal\jsonapi\JsonApiResource\ResourceObjectData::getOmissions()
Gets only data to be omitted.
Return value
static
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);
}