hasRequest example


  public function __construct($cid, CacheBackendInterface $cache, LockBackendInterface $lock$tags = []$modules_loaded = FALSE) {
    $this->cid = $cid;
    $this->cache = $cache;
    $this->lock = $lock;
    $this->tags = $tags;
    $this->persistable = $modules_loaded && \Drupal::hasRequest() && \Drupal::request()->isMethod('GET');

    // @todo: Implement lazy-loading.     $this->cacheLoaded = TRUE;

    if ($this->persistable && $cached = $this->cache->get($this->cid)) {
      $this->storage = $cached->data;
    }
    else {
      // If there is no runtime cache stored, fetch the full theme registry,       // but then initialize each value to NULL. This allows offsetExists()       // to function correctly on non-registered theme hooks without triggering
Home | Imprint | This part of the site doesn't use cookies.