5 * Describes hooks provided by the HAL module.
14 * Alter the HAL type URI.
16 * Modules may wish to alter the type URI generated for a resource based on the
17 * context of the serializer/normalizer operation.
21 * @param array $context
22 * The context from the serializer/normalizer operation.
24 * @see \Symfony\Component\Serializer\SerializerInterface::serialize()
25 * @see \Symfony\Component\Serializer\SerializerInterface::deserialize()
26 * @see \Symfony\Component\Serializer\NormalizerInterface::normalize()
27 * @see \Symfony\Component\Serializer\DenormalizerInterface::denormalize()
29 function hook_hal_type_uri_alter(&$uri, $context = []) {
30 if ($context['mymodule'] == TRUE) {
31 $base = \Drupal::config('hal.settings')->get('link_domain');
32 $uri = str_replace($base, 'http://mymodule.domain', $uri);
37 * Alter the HAL relation URI.
39 * Modules may wish to alter the relation URI generated for a resource based on
40 * the context of the serializer/normalizer operation.
44 * @param array $context
45 * The context from the serializer/normalizer operation.
47 * @see \Symfony\Component\Serializer\SerializerInterface::serialize()
48 * @see \Symfony\Component\Serializer\SerializerInterface::deserialize()
49 * @see \Symfony\Component\Serializer\NormalizerInterface::normalize()
50 * @see \Symfony\Component\Serializer\DenormalizerInterface::denormalize()
52 function hook_hal_relation_uri_alter(&$uri, $context = []) {
53 if ($context['mymodule'] == TRUE) {
54 $base = \Drupal::config('hal.settings')->get('link_domain');
55 $uri = str_replace($base, 'http://mymodule.domain', $uri);
60 * @} End of "addtogroup hooks".