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);
38 * Alter the HAL relation URI.
40 * Modules may wish to alter the relation URI generated for a resource based on
41 * the context of the serializer/normalizer operation.
45 * @param array $context
46 * The context from the serializer/normalizer operation.
48 * @see \Symfony\Component\Serializer\SerializerInterface::serialize()
49 * @see \Symfony\Component\Serializer\SerializerInterface::deserialize()
50 * @see \Symfony\Component\Serializer\NormalizerInterface::normalize()
51 * @see \Symfony\Component\Serializer\DenormalizerInterface::denormalize()
53 function hook_hal_relation_uri_alter(&$uri, $context = []) {
54 if ($context['mymodule'] == TRUE) {
55 $base = \Drupal::config('hal.settings')->get('link_domain');
56 $uri = str_replace($base, 'http://mymodule.domain', $uri);
61 * @} End of "addtogroup hooks".