"Fossies" - the Fresh Open Source Software Archive

Member "drupal-8.9.10/core/modules/jsonapi/src/JsonApiResource/OmittedData.php" (26 Nov 2020, 963 Bytes) of package /linux/www/drupal-8.9.10.tar.gz:


As a special service "Fossies" has tried to format the requested source page into HTML format using (guessed) PHP source code syntax highlighting (style: standard) with prefixed line numbers and code folding option. Alternatively you can here view or download the uninterpreted source code file. For more information about "OmittedData.php" see the Fossies "Dox" file reference documentation.

    1 <?php
    2 
    3 namespace Drupal\jsonapi\JsonApiResource;
    4 
    5 use Drupal\Component\Assertion\Inspector;
    6 use Drupal\jsonapi\Exception\EntityAccessDeniedHttpException;
    7 
    8 /**
    9  * Represents resource data that should be omitted from the JSON:API document.
   10  *
   11  * @internal JSON:API maintains no PHP API. The API is the HTTP API. This class
   12  *   may change at any time and could break any dependencies on it.
   13  *
   14  * @see https://www.drupal.org/project/drupal/issues/3032787
   15  * @see jsonapi.api.php
   16  */
   17 class OmittedData extends ResourceObjectData {
   18 
   19   /**
   20    * OmittedData constructor.
   21    *
   22    * @param \Drupal\jsonapi\Exception\EntityAccessDeniedHttpException[] $data
   23    *   Resource objects that are the primary data for the response.
   24    *
   25    * @see \Drupal\jsonapi\JsonApiResource\Data::__construct
   26    */
   27   public function __construct(array $data) {
   28     assert(Inspector::assertAllObjects($data, EntityAccessDeniedHttpException::class));
   29     parent::__construct($data, -1);
   30   }
   31 
   32 }