JsonapiTestNonCacheableMethodsHooks.php

Namespace

Drupal\jsonapi_test_non_cacheable_methods\Hook

File

core/modules/jsonapi/tests/modules/jsonapi_test_non_cacheable_methods/src/Hook/JsonapiTestNonCacheableMethodsHooks.php

View source
<?php

declare (strict_types=1);
namespace Drupal\jsonapi_test_non_cacheable_methods\Hook;

use Drupal\Core\Url;
use Drupal\Core\Entity\EntityInterface;
use Drupal\Core\Hook\Attribute\Hook;

/**
 * Hook implementations for jsonapi_test_non_cacheable_methods.
 */
class JsonapiTestNonCacheableMethodsHooks {
    
    /**
     * Implements hook_entity_presave().
     */
    public function entityPresave(EntityInterface $entity) {
        Url::fromRoute('<front>')->toString();
    }
    
    /**
     * Implements hook_entity_predelete().
     */
    public function entityPredelete(EntityInterface $entity) {
        Url::fromRoute('<front>')->toString();
    }

}

Classes

Title Deprecated Summary
JsonapiTestNonCacheableMethodsHooks Hook implementations for jsonapi_test_non_cacheable_methods.

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