708b9ab13e4fb4c6ed3c0b2ae84a9fb7841c0e60
[yaffs-website] / web / core / modules / hal / src / LinkManager / TypeLinkManagerInterface.php
1 <?php
2
3 namespace Drupal\hal\LinkManager;
4
5 interface TypeLinkManagerInterface extends ConfigurableLinkManagerInterface {
6
7   /**
8    * Gets the URI that corresponds to a bundle.
9    *
10    * When using hypermedia formats, this URI can be used to indicate which
11    * bundle the data represents. Documentation about required and optional
12    * fields can also be provided at this URI.
13    *
14    * @param $entity_type
15    *   The bundle's entity type.
16    * @param $bundle
17    *   The bundle name.
18    * @param array $context
19    *   (optional) Optional serializer/normalizer context.
20    *
21    * @return string
22    *   The corresponding URI for the bundle.
23    */
24   public function getTypeUri($entity_type, $bundle, $context = []);
25
26   /**
27    * Get a bundle's Typed Data IDs based on a URI.
28    *
29    * @param string $type_uri
30    *   The type URI.
31    * @param array $context
32    *   Context from the normalizer/serializer operation.
33    *
34    * @return array|bool
35    *   If the URI matches a bundle, returns an array containing entity_type and
36    *   bundle. Otherwise, returns false.
37    */
38   public function getTypeInternalIds($type_uri, $context = []);
39
40 }