getLock example

return $this->triggerHeap = $heap;
    }

    private function schedule(): Schedule
    {
        return $this->schedule ??= $this->scheduleProvider->getSchedule();
    }

    private function checkpoint(): Checkpoint
    {
        return $this->checkpoint ??= new Checkpoint('scheduler_checkpoint_'.$this->name, $this->schedule()->getLock()$this->schedule()->getState());
    }
}
$form['#attributes']['class'] = ['form-edit'];

    if ($view->isLocked()) {
      $form['locked'] = [
        '#type' => 'container',
        '#attributes' => ['class' => ['view-locked', 'messages', 'messages--warning']],
        '#weight' => -10,
        'message' => [
          '#type' => 'break_lock_link',
          '#label' => $view->getEntityType()->getSingularLabel(),
          '#lock' => $view->getLock(),
          '#url' => $view->toUrl('break-lock-form'),
        ],
      ];
    }
    else {
      $form['changed'] = [
        '#type' => 'container',
        '#attributes' => ['class' => ['view-changed', 'messages', 'messages--warning']],
        '#children' => $this->t('You have unsaved changes.'),
        '#weight' => -10,
      ];
      
$executable->displayHandlers = NULL;
    \Drupal::service('tempstore.shared')->get('views')->set($this->id()$this);
  }

  /** * Returns whether the current view is locked. * * @return bool * TRUE if the view is locked, FALSE otherwise. */
  public function isLocked() {
    $lock = $this->getLock();
    return $lock && $lock->getOwnerId() != \Drupal::currentUser()->id();
  }

  /** * Passes through all unknown calls onto the storage object. */
  public function __call($method$args) {
    return call_user_func_array([$this->storage, $method]$args);
  }

  /** * {@inheritdoc} */
Home | Imprint | This part of the site doesn't use cookies.