function ResourceObjectData::getOmissions
Same name 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()
- 11.x 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);
}
Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.