jsonapi_test_non_cacheable_methods.module

Same filename and directory in other branches
  1. 9 core/modules/jsonapi/tests/modules/jsonapi_test_non_cacheable_methods/jsonapi_test_non_cacheable_methods.module
  2. 10 core/modules/jsonapi/tests/modules/jsonapi_test_non_cacheable_methods/jsonapi_test_non_cacheable_methods.module

Contains hook implementations for testing the JSON:API module.

@see: https://www.drupal.org/project/drupal/issues/3072076.

File

core/modules/jsonapi/tests/modules/jsonapi_test_non_cacheable_methods/jsonapi_test_non_cacheable_methods.module

View source
<?php


/**
 * @file
 * Contains hook implementations for testing the JSON:API module.
 *
 * @see: https://www.drupal.org/project/drupal/issues/3072076.
 */
use Drupal\Core\Entity\EntityInterface;
use Drupal\Core\Url;

/**
 * Implements hook_entity_presave().
 */
function jsonapi_test_non_cacheable_methods_entity_presave(EntityInterface $entity) {
    Url::fromRoute('<front>')->toString();
}

/**
 * Implements hook_entity_predelete().
 */
function jsonapi_test_non_cacheable_methods_entity_predelete(EntityInterface $entity) {
    Url::fromRoute('<front>')->toString();
}

Functions

Title Deprecated Summary
jsonapi_test_non_cacheable_methods_entity_predelete Implements hook_entity_predelete().
jsonapi_test_non_cacheable_methods_entity_presave Implements hook_entity_presave().

Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.