Chris@18: $entity, Chris@18: 'pointer' => $pointer, Chris@18: 'reason' => NULL, Chris@18: 'relationship_field' => $relationship_field, Chris@18: ]; Chris@18: if ($entity_access instanceof AccessResultReasonInterface) { Chris@18: $error['reason'] = $entity_access->getReason(); Chris@18: } Chris@18: $this->error = $error; Chris@18: // @todo: remove this ternary operation in https://www.drupal.org/project/jsonapi/issues/2997594. Chris@18: $this->resourceIdentifier = $entity ? ResourceIdentifier::fromEntity($entity) : NULL; Chris@18: } Chris@18: Chris@18: /** Chris@18: * Returns the error. Chris@18: * Chris@18: * @return array Chris@18: * The error. Chris@18: */ Chris@18: public function getError() { Chris@18: return $this->error; Chris@18: } Chris@18: Chris@18: }