Skip to main content
Drupal API
User account menu
  • Log in

Breadcrumb

  1. Drupal Core 11.1.x
  2. TopLevelDataInterface.php

interface TopLevelDataInterface

Interface for objects that can appear as top-level object data.

@internal JSON:API maintains no PHP API since its API is the HTTP API. This class may change at any time and this will break any dependencies on it.

Hierarchy

  • interface \Drupal\jsonapi\JsonApiResource\TopLevelDataInterface

Expanded class hierarchy of TopLevelDataInterface

All classes that implement TopLevelDataInterface

See also

https://www.drupal.org/project/drupal/issues/3032787

jsonapi.api.php

1 file declares its use of TopLevelDataInterface
EntityResource.php in core/modules/jsonapi/src/Controller/EntityResource.php

File

core/modules/jsonapi/src/JsonApiResource/TopLevelDataInterface.php, line 14

Namespace

Drupal\jsonapi\JsonApiResource
View source
interface TopLevelDataInterface {
    
    /**
     * Returns the data for the top-level data member of a JSON:API document.
     *
     * @return \Drupal\jsonapi\JsonApiResource\Data
     *   The top-level data.
     */
    public function getData();
    
    /**
     * Returns the data that was omitted from the JSON:API document.
     *
     * @return \Drupal\jsonapi\JsonApiResource\OmittedData
     *   The omitted data.
     */
    public function getOmissions();
    
    /**
     * Merges the object's links with the top-level links.
     *
     * @param \Drupal\jsonapi\JsonApiResource\LinkCollection $top_level_links
     *   The top-level links to merge.
     *
     * @return \Drupal\jsonapi\JsonApiResource\LinkCollection
     *   The merged links.
     */
    public function getMergedLinks(LinkCollection $top_level_links);
    
    /**
     * Merges the object's meta member with the top-level meta member.
     *
     * @param array $top_level_meta
     *   The top-level links to merge.
     *
     * @return array
     *   The merged meta member.
     */
    public function getMergedMeta(array $top_level_meta);

}

Members

Title Sort descending Modifiers Object type Summary Overrides
TopLevelDataInterface::getData public function Returns the data for the top-level data member of a JSON:API document. 2
TopLevelDataInterface::getMergedLinks public function Merges the object's links with the top-level links. 2
TopLevelDataInterface::getMergedMeta public function Merges the object's meta member with the top-level meta member. 2
TopLevelDataInterface::getOmissions public function Returns the data that was omitted from the JSON:API document. 2

API Navigation

  • Drupal Core 11.1.x
  • Topics
  • Classes
  • Functions
  • Constants
  • Globals
  • Files
  • Namespaces
  • Deprecated
  • Services
RSS feed
Powered by Drupal