You are here

class FormsSteps in Forms Steps 8

FormsSteps configuration entity to persistently store configuration.

Plugin annotation


@ConfigEntityType(
  id = "forms_steps",
  label = @Translation("FormsSteps"),
  handlers = {
    "list_builder" = "Drupal\forms_steps\Controller\FormsStepsListBuilder",
    "form" = {
       "add" = "\Drupal\forms_steps\Form\FormsStepsAddForm",
       "edit" = "\Drupal\forms_steps\Form\FormsStepsEditForm",
       "delete" = "\Drupal\Core\Entity\EntityDeleteForm",
       "add-step" = "\Drupal\forms_steps\Form\FormsStepsStepAddForm",
       "edit-step" = "\Drupal\forms_steps\Form\FormsStepsStepEditForm",
       "delete-step" = "\Drupal\Core\Entity\EntityDeleteForm",
       "add-progress-step" = "\Drupal\forms_steps\Form\FormsStepsProgressStepAddForm",
       "edit-progress-step" = "\Drupal\forms_steps\Form\FormsStepsProgressStepEditForm",
       "delete-progress-step" = "\Drupal\Core\Entity\EntityDeleteForm",
     }
  },
  admin_permission = "administer forms_steps",
  config_prefix = "forms_steps",
  entity_keys = {
    "id" = "id",
    "label" = "label",
    "uuid" = "uuid",
  },
  config_export = {
    "id",
    "label",
    "description",
    "progress_steps_links_saved_only",
    "progress_steps_links_saved_only_next",
    "redirection_policy",
    "redirection_target",
    "steps",
    "progress_steps",
  },
  links = {
    "collection" = "/admin/config/workflow/forms_steps",
    "edit-form" = "/admin/config/workflow/forms_steps/edit/{forms_steps}",
    "delete-form" =
  "/admin/config/workflow/forms_steps/delete/{forms_steps}",
    "add-form" = "/admin/config/workflow/forms_steps/add",
    "add-step-form" =
  "/admin/config/workflow/forms_steps/{forms_steps}/add_step",
    "add-progress-step-form" =
  "/admin/config/workflow/forms_steps/{forms_steps}/add_progress_step",
  }
)

Hierarchy

Expanded class hierarchy of FormsSteps

5 files declare their use of FormsSteps
FormsStepsCommands.php in src/Commands/FormsStepsCommands.php
FormsStepsEditForm.php in src/Form/FormsStepsEditForm.php
FormsStepsManager.php in src/Service/FormsStepsManager.php
RouteSubscriber.php in src/EventSubscriber/RouteSubscriber.php
StepChangeEvent.php in src/Event/StepChangeEvent.php
1 string reference to 'FormsSteps'
forms_steps.schema.yml in config/schema/forms_steps.schema.yml
config/schema/forms_steps.schema.yml

File

src/Entity/FormsSteps.php, line 62

Namespace

Drupal\forms_steps\Entity
View source
class FormsSteps extends ConfigEntityBase implements FormsStepsInterface {

  /**
   * Entity type id. */
  const ENTITY_TYPE = 'forms_steps';

  /**
   * The unique ID of the Forms Steps.
   *
   * @var string
   */
  public $id = NULL;

  /**
   * The label of the FormsSteps.
   *
   * @var string
   */
  protected $label;

  /**
   * The description of the FormsSteps, which is used only in the interface.
   *
   * @var string
   */
  protected $description = '';

  /**
   * The progress_steps_links_saved_only setting of the FormsSteps.
   *
   * @var string
   */
  protected $progress_steps_links_saved_only = '';

  /**
   * The progress_steps_links_saved_only_next setting of the FormsSteps.
   *
   * @var string
   */
  protected $progress_steps_links_saved_only_next = '';

  /**
   * The redirection policy of the FormsSteps.
   *
   * @var string
   */
  protected $redirection_policy = '';

  /**
   * The redirection target of the FormsSteps.
   *
   * @var string
   */
  protected $redirection_target = '';

  /**
   * The ordered FormsSteps steps.
   *
   * Steps array. The array is numerically indexed by the step id and contains
   * arrays with the following structure:
   *   - weight: weight of the step
   *   - label: label of the step
   *   - form_id: form id of the step
   *   - form_mode: form mode of the form of the step
   *   - url: url of the step.
   *
   * @var array
   */
  protected $steps = [];

  /**
   * The ordered FormsSteps progress steps.
   *
   * Progress steps array. The array is numerically indexed by the progress step
   * id and contains arrays with the following structure:
   *   - weight: weight of the progress step
   *   - label: label of the progress step
   *   - form_id: form id of the progress step
   *   - routes: an array of the routes for which the progress step is active
   *   - link: the link of the progress step.
   *
   * @var array
   */
  protected $progress_steps = [];

  /**
   * Returns the description.
   */
  public function getDescription() {
    return $this->description;
  }

  /**
   * Returns the Progress steps links saved only setting.
   */
  public function getProgressStepsLinksSavedOnly() {
    return $this->progress_steps_links_saved_only;
  }

  /**
   * Returns the Progress steps links saved only next setting.
   */
  public function getProgressStepsLinksSavedOnlyNext() {
    return $this->progress_steps_links_saved_only_next;
  }

  /**
   * Returns the redirection policy.
   */
  public function getRedirectionPolicy() {
    return $this->redirection_policy;
  }

  /**
   * Returns the redirection target.
   */
  public function getRedirectionTarget() {
    return $this->redirection_target;
  }

  /**
   * {@inheritdoc}
   */
  public function addStep($step_id, $label, $entityType, $entityBundle, $formMode, $url) {
    if (isset($this->Steps[$step_id])) {
      throw new \InvalidArgumentException("The Step '{$step_id}' already exists in the forms steps '{$this->id()}'");
    }
    if (preg_match('/[^a-z0-9_]+/', $step_id)) {
      throw new \InvalidArgumentException("The Step ID '{$step_id}' must contain only lowercase letters, numbers, and underscores");
    }
    $this->steps[$step_id] = [
      'label' => $label,
      'weight' => $this
        ->getNextWeight($this->steps),
      'entity_type' => $entityType,
      'entity_bundle' => $entityBundle,
      'form_mode' => $formMode,
      'url' => $url,
    ];
    ksort($this->steps);
    return $this;
  }

  /**
   * {@inheritdoc}
   */
  public function addProgressStep($progress_step_id, $label, array $routes, $link, array $link_visibility) {
    if (isset($this->progress_steps[$progress_step_id])) {
      throw new \InvalidArgumentException("The Progress Step '{$progress_step_id}' already exists in the forms steps '{$this->id()}'");
    }
    if (preg_match('/[^a-z0-9_]+/', $progress_step_id)) {
      throw new \InvalidArgumentException("The Progress Step ID '{$progress_step_id}' must contain only lowercase letters, numbers, and underscores");
    }
    $this->progress_steps[$progress_step_id] = [
      'label' => $label,
      'weight' => $this
        ->getNextWeight($this->progress_steps),
      'routes' => $routes,
      'link' => $link,
      'link_visibility' => $link_visibility,
    ];
    ksort($this->progress_steps);
    return $this;
  }

  /**
   * {@inheritdoc}
   */
  public function hasStep($step_id) {
    return isset($this->steps[$step_id]);
  }

  /**
   * {@inheritdoc}
   */
  public function hasProgressStep($progress_step_id) {
    return isset($this->progress_steps[$progress_step_id]);
  }

  /**
   * {@inheritdoc}
   */
  public function getNextStep(Step $step) {
    $nextStep = NULL;
    foreach ($this
      ->getSteps() as $current_step) {
      if (is_null($nextStep)) {
        $nextStep = $current_step;
      }
      else {
        if ($nextStep
          ->weight() < $current_step
          ->weight()) {
          $nextStep = $current_step;
          if ($nextStep
            ->weight() > $step
            ->weight()) {
            break;
          }
        }
      }
    }
    if (is_null($nextStep)) {
      return NULL;
    }
    else {
      return $nextStep;
    }
  }

  /**
   * {@inheritdoc}
   */
  public function getPreviousStep(Step $step) {
    $previousStep = NULL;

    // Reverse the order of the array.
    $stepsReversed = array_reverse($this
      ->getSteps());
    $stepsIterator = new \ArrayIterator($stepsReversed);
    while ($stepsIterator
      ->valid()) {
      if (strcmp($stepsIterator
        ->current()
        ->id(), $step
        ->id()) == 0) {
        $stepsIterator
          ->next();
        $previousStep = $stepsIterator
          ->current();
        break;
      }
      else {
        $stepsIterator
          ->next();
      }
    }
    return $previousStep;
  }

  /**
   * {@inheritdoc}
   */
  public function getStepRoute(Step $step) {
    $route = 'forms_steps.' . $this->id . '.' . $step
      ->id();
    return $route;
  }

  /**
   * {@inheritdoc}
   */
  public function getNextStepRoute(Step $step) {
    $nextRoute = NULL;
    $nextStep = $this
      ->getNextStep($step);
    if ($nextStep) {
      $nextRoute = 'forms_steps.' . $this->id . '.' . $nextStep
        ->id();
    }
    return $nextRoute;
  }

  /**
   * Returns the previous step route.
   *
   * @param \Drupal\forms_steps\Step $step
   *   Current Step.
   *
   * @return null|string
   *   Returns the previous route.
   */
  public function getPreviousStepRoute(Step $step) {
    $previousRoute = NULL;
    $previousStep = $this
      ->getPreviousStep($step);
    if ($previousStep) {
      $previousRoute = 'forms_steps.' . $this->id . '.' . $previousStep
        ->id();
    }
    return $previousRoute;
  }

  /**
   * {@inheritdoc}
   */
  public function getSteps(array $step_ids = NULL) {
    if ($step_ids === NULL) {
      $step_ids = array_keys($this->steps);
    }

    /** @var \Drupal\forms_steps\StepInterface[] $steps */
    $steps = array_combine($step_ids, array_map([
      $this,
      'getStep',
    ], $step_ids));
    if (count($steps) > 1) {

      // Sort Steps by weight and then label.
      $weights = $labels = [];
      foreach ($steps as $id => $step) {
        $weights[$id] = $step
          ->weight();
        $labels[$id] = $step
          ->label();
      }
      array_multisort($weights, SORT_NUMERIC, SORT_ASC, $labels, SORT_NATURAL, SORT_ASC);
      $steps = array_replace($weights, $steps);
    }
    return $steps;
  }

  /**
   * {@inheritdoc}
   */
  public function getProgressSteps(array $progress_step_ids = NULL) {
    if ($progress_step_ids === NULL) {
      $progress_step_ids = array_keys($this->progress_steps);
    }

    /** @var \Drupal\forms_steps\ProgressStepInterface[] $progress_steps */
    $progress_steps = array_combine($progress_step_ids, array_map([
      $this,
      'getProgressStep',
    ], $progress_step_ids));
    if (count($progress_steps) > 1) {

      // Sort Steps by weight and then label.
      $weights = $labels = [];
      foreach ($progress_steps as $id => $progress_step) {
        $weights[$id] = $progress_step
          ->weight();
        $labels[$id] = $progress_step
          ->label();
      }
      array_multisort($weights, SORT_NUMERIC, SORT_ASC, $labels, SORT_NATURAL, SORT_ASC);
      $progress_steps = array_replace($weights, $progress_steps);
    }
    return $progress_steps;
  }

  /**
   * {@inheritdoc}
   */
  public function getFirstStep($steps = NULL) {
    if ($steps === NULL) {
      $steps = $this
        ->getSteps();
    }
    return reset($steps);
  }

  /**
   * {@inheritdoc}
   */
  public function getLastStep($steps = NULL) {
    if ($steps === NULL) {
      $steps = $this
        ->getSteps();
    }
    return end($steps);
  }

  /**
   * {@inheritdoc}
   */
  public function getStep($step_id) {
    if (!isset($this->steps[$step_id])) {
      throw new \InvalidArgumentException("The Step '{$step_id}' does not exist in forms steps '{$this->id()}'");
    }
    $step = new Step($this, $step_id, $this->steps[$step_id]['label'], $this->steps[$step_id]['weight'], $this->steps[$step_id]['entity_type'], $this->steps[$step_id]['entity_bundle'], $this->steps[$step_id]['form_mode'], $this->steps[$step_id]['url']);
    if (isset($this->steps[$step_id]['cancelStepMode'])) {
      $step
        ->setCancelStepMode($this->steps[$step_id]['cancelStepMode']);
    }
    if (isset($this->steps[$step_id]['cancelRoute'])) {
      $step
        ->setCancelRoute($this->steps[$step_id]['cancelRoute']);
    }
    if (isset($this->steps[$step_id]['submitLabel'])) {
      $step
        ->setSubmitLabel($this->steps[$step_id]['submitLabel']);
    }
    if (isset($this->steps[$step_id]['cancelLabel'])) {
      $step
        ->setCancelLabel($this->steps[$step_id]['cancelLabel']);
    }
    if (isset($this->steps[$step_id]['cancelStep'])) {
      $step
        ->setCancelStep($this
        ->getStep($this->steps[$step_id]['cancelStep']));
    }
    if (isset($this->steps[$step_id]['hideDelete'])) {
      $step
        ->setHideDelete($this->steps[$step_id]['hideDelete']);
    }
    if (isset($this->steps[$step_id]['deleteLabel']) && (!isset($this->steps[$step_id]['hideDelete']) || !$this->steps[$step_id]['hideDelete'])) {
      $step
        ->setDeleteLabel($this->steps[$step_id]['deleteLabel']);
    }
    if (isset($this->steps[$step_id]['displayPrevious'])) {
      $step
        ->setDisplayPrevious($this->steps[$step_id]['displayPrevious']);
    }
    if (isset($this->steps[$step_id]['previousLabel'])) {
      $step
        ->setPreviousLabel($this->steps[$step_id]['previousLabel']);
    }
    return $step;
  }

  /**
   * {@inheritdoc}
   */
  public function getProgressStep($progress_step_id) {
    if (!isset($this->progress_steps[$progress_step_id])) {
      throw new \InvalidArgumentException("The progress step '{$progress_step_id}' does not exist in forms steps '{$this->id()}'");
    }
    $progress_step = new ProgressStep($this, $progress_step_id, $this->progress_steps[$progress_step_id]['label'], $this->progress_steps[$progress_step_id]['weight'], isset($this->progress_steps[$progress_step_id]['routes']) ? $this->progress_steps[$progress_step_id]['routes'] : [], isset($this->progress_steps[$progress_step_id]['link']) ? $this->progress_steps[$progress_step_id]['link'] : '', isset($this->progress_steps[$progress_step_id]['link_visibility']) ? $this->progress_steps[$progress_step_id]['link_visibility'] : []);
    return $progress_step;
  }

  /**
   * {@inheritdoc}
   */
  public function setStepLabel($step_id, $label) {
    if (!isset($this->steps[$step_id])) {
      throw new \InvalidArgumentException("The Step '{$step_id}' does not exist in forms steps '{$this->id()}'");
    }
    $this->steps[$step_id]['label'] = $label;
    return $this;
  }

  /**
   * {@inheritdoc}
   */
  public function setProgressStepLabel($progress_step_id, $label) {
    if (!isset($this->progress_steps[$progress_step_id])) {
      throw new \InvalidArgumentException("The progress step '{$progress_step_id}' does not exist in forms steps '{$this->id()}'");
    }
    $this->progress_steps[$progress_step_id]['label'] = $label;
    return $this;
  }

  /**
   * {@inheritdoc}
   */
  public function setStepWeight($step_id, $weight) {
    if (!isset($this->steps[$step_id])) {
      throw new \InvalidArgumentException("The Step '{$step_id}' does not exist in forms steps '{$this->id()}'");
    }
    $this->steps[$step_id]['weight'] = $weight;
    return $this;
  }

  /**
   * {@inheritdoc}
   */
  public function setProgressStepWeight($progress_step_id, $weight) {
    if (!isset($this->progress_steps[$progress_step_id])) {
      throw new \InvalidArgumentException("The progress step '{$progress_step_id}' does not exist in forms steps '{$this->id()}'");
    }
    $this->progress_steps[$progress_step_id]['weight'] = $weight;
    return $this;
  }

  /**
   * {@inheritdoc}
   */
  public function setStepEntityBundle($step_id, $entityBundle) {
    if (!isset($this->steps[$step_id])) {
      throw new \InvalidArgumentException("The Step '{$step_id}' does not exist in forms steps '{$this->id()}'");
    }
    $this->steps[$step_id]['entity_bundle'] = $entityBundle;
    return $this;
  }

  /**
   * {@inheritdoc}
   */
  public function setStepUrl($step_id, $url) {
    if (!isset($this->steps[$step_id])) {
      throw new \InvalidArgumentException("The Step '{$step_id}' does not exist in forms steps '{$this->id()}'");
    }
    $this->steps[$step_id]['url'] = '';
    if ('/' != $url[0]) {
      $url = '/' . $url;
    }
    if (!empty(Url::fromUri("internal:{$url}"))) {
      $this->steps[$step_id]['url'] = $url;
    }
    else {
      throw new \InvalidArgumentException("The Url Step '{$url}' is not accessible");
    }
    return $this;
  }

  /**
   * {@inheritdoc}
   */
  public function setStepFormMode($step_id, $formMode) {
    if (!isset($this->steps[$step_id])) {
      throw new \InvalidArgumentException("The Step '{$step_id}' does not exist in forms steps '{$this->id()}'");
    }
    $this->steps[$step_id]['form_mode'] = $formMode;
    return $this;
  }

  /**
   * {@inheritdoc}
   */
  public function setStepEntityType($step_id, $entity_type) {
    if (!isset($this->steps[$step_id])) {
      throw new \InvalidArgumentException("The Step '{$step_id}' does not exist in forms steps '{$this->id()}'");
    }
    $this->steps[$step_id]['entity_type'] = $entity_type;
    return $this;
  }

  /**
   * {@inheritdoc}
   */
  public function setStepSubmitLabel($step_id, $label) {
    if (!isset($this->steps[$step_id])) {
      throw new \InvalidArgumentException("The Step '{$step_id}' does not exist in forms steps '{$this->id()}'");
    }
    $this->steps[$step_id]['submitLabel'] = $label;
    return $this;
  }

  /**
   * {@inheritdoc}
   */
  public function setStepCancelLabel($step_id, $label) {
    if (!isset($this->steps[$step_id])) {
      throw new \InvalidArgumentException("The Step '{$step_id}' does not exist in forms steps '{$this->id()}'");
    }
    $this->steps[$step_id]['cancelLabel'] = $label;
    return $this;
  }

  /**
   * {@inheritdoc}
   */
  public function setStepCancelRoute($step_id, $route) {
    if (!isset($this->steps[$step_id])) {
      throw new \InvalidArgumentException("The Step '{$step_id}' does not exist in forms steps '{$this->id()}'");
    }
    $this->steps[$step_id]['cancelRoute'] = $route;
    return $this;
  }

  /**
   * {@inheritdoc}
   */
  public function setStepCancelStep($step_id, Step $step = NULL) {
    if (!$step) {
      return $this;
    }
    if (!isset($this->steps[$step_id])) {
      throw new \InvalidArgumentException("The Step '{$step_id}' does not exist in forms steps '{$this->id()}'");
    }
    $this->steps[$step_id]['cancelStep'] = $step;
    return $this;
  }

  /**
   * {@inheritdoc}
   */
  public function setStepCancelStepMode($step_id, $mode) {
    if (!isset($this->steps[$step_id])) {
      throw new \InvalidArgumentException("The Step '{$step_id}' does not exist in forms steps '{$this->id()}'");
    }
    $this->steps[$step_id]['cancelStepMode'] = $mode;
    return $this;
  }

  /**
   * {@inheritdoc}
   */
  public function setStepDeleteLabel($step_id, $label) {
    if (!isset($this->steps[$step_id])) {
      throw new \InvalidArgumentException("The Step '{$step_id}' does not exist in forms steps '{$this->id()}'");
    }
    $this->steps[$step_id]['deleteLabel'] = $label;
    return $this;
  }

  /**
   * {@inheritdoc}
   */
  public function setStepDeleteState($step_id, $state) {
    if (!isset($this->steps[$step_id])) {
      throw new \InvalidArgumentException("The Step '{$step_id}' does not exist in forms steps '{$this->id()}'");
    }
    $this->steps[$step_id]['hideDelete'] = $state;
    return $this;
  }

  /**
   * {@inheritdoc}
   */
  public function setProgressStepActiveRoutes($progress_step_id, array $routes) {
    if (!isset($this->progress_steps[$progress_step_id])) {
      throw new \InvalidArgumentException("The progress step '{$progress_step_id}' does not exist in forms steps '{$this->id()}'");
    }
    $this->progress_steps[$progress_step_id]['routes'] = $routes;
    return $this;
  }

  /**
   * {@inheritdoc}
   */
  public function setProgressStepLink($progress_step_id, $link) {
    if (!isset($this->progress_steps[$progress_step_id])) {
      throw new \InvalidArgumentException("The progress step '{$progress_step_id}' does not exist in forms steps '{$this->id()}'");
    }
    $this->progress_steps[$progress_step_id]['link'] = $link;
    return $this;
  }

  /**
   * {@inheritdoc}
   */
  public function setProgressStepLinkVisibility($progress_step_id, array $steps) {
    if (!isset($this->progress_steps[$progress_step_id])) {
      throw new \InvalidArgumentException("The progress step '{$progress_step_id}' does not exist in forms steps '{$this->id()}'");
    }
    $this->progress_steps[$progress_step_id]['link_visibility'] = $steps;
    return $this;
  }

  /**
   * {@inheritdoc}
   */
  public function deleteStep($step_id) {
    if (!isset($this->steps[$step_id])) {
      throw new \InvalidArgumentException("The step '{$step_id}' does not exist in forms steps '{$this->id()}'");
    }
    if (count($this->steps) === 1) {
      throw new \InvalidArgumentException("The step '{$step_id}' can not be deleted from forms steps '{$this->id()}' as it is the only Step");
    }
    unset($this->steps[$step_id]);
    return $this;
  }

  /**
   * {@inheritdoc}
   */
  public function deleteProgressStep($progress_step_id) {
    if (!isset($this->progress_steps[$progress_step_id])) {
      throw new \InvalidArgumentException("The progress step '{$progress_step_id}' does not exist in forms steps '{$this->id()}'");
    }
    unset($this->progress_steps[$progress_step_id]);
    return $this;
  }

  /**
   * Gets the weight for a new step or progress step.
   *
   * @param array $items
   *   An array of steps where each item has a
   *   'weight' key with a numeric value.
   *
   * @return int
   *   The weight for a step in the array so that it has the highest weight.
   */
  protected function getNextWeight(array $items) {
    return array_reduce($items, function ($carry, $item) {
      return max($carry, $item['weight'] + 1);
    }, 0);
  }

  /**
   * {@inheritdoc}
   */
  public function status() {

    // In order for a forms_steps to be usable it must have at least one step.
    return !empty($this->status) && !empty($this->steps);
  }

  /**
   * {@inheritdoc}
   */
  public function setStepPreviousLabel($step_id, $label) {
    if (!isset($this->steps[$step_id])) {
      throw new \InvalidArgumentException("The Step '{$step_id}' does not exist in forms steps '{$this->id()}'");
    }
    $this->steps[$step_id]['previousLabel'] = $label;
    return $this;
  }

  /**
   * {@inheritdoc}
   */
  public function setStepPreviousState($step_id, $state) {
    if (!isset($this->steps[$step_id])) {
      throw new \InvalidArgumentException("The Step '{$step_id}' does not exist in forms steps '{$this->id()}'");
    }
    $this->steps[$step_id]['displayPrevious'] = $state;
    return $this;
  }

}

Members

Namesort descending Modifiers Type Description Overrides
CacheableDependencyTrait::$cacheContexts protected property Cache contexts.
CacheableDependencyTrait::$cacheMaxAge protected property Cache max-age.
CacheableDependencyTrait::$cacheTags protected property Cache tags.
CacheableDependencyTrait::setCacheability protected function Sets cacheability; useful for value object constructors.
ConfigEntityBase::$isUninstalling private property Whether the config is being deleted by the uninstall process.
ConfigEntityBase::$langcode protected property The language code of the entity's default language.
ConfigEntityBase::$originalId protected property The original ID of the configuration entity.
ConfigEntityBase::$status protected property The enabled/disabled status of the configuration entity. 4
ConfigEntityBase::$third_party_settings protected property Third party entity settings.
ConfigEntityBase::$trustedData protected property Trust supplied data and not use configuration schema on save.
ConfigEntityBase::$uuid protected property The UUID for this entity.
ConfigEntityBase::$_core protected property Information maintained by Drupal core about configuration.
ConfigEntityBase::addDependency protected function Overrides \Drupal\Core\Entity\DependencyTrait:addDependency().
ConfigEntityBase::calculateDependencies public function Calculates dependencies and stores them in the dependency property. Overrides ConfigEntityInterface::calculateDependencies 13
ConfigEntityBase::createDuplicate public function Creates a duplicate of the entity. Overrides EntityBase::createDuplicate 1
ConfigEntityBase::disable public function Disables the configuration entity. Overrides ConfigEntityInterface::disable 1
ConfigEntityBase::enable public function Enables the configuration entity. Overrides ConfigEntityInterface::enable
ConfigEntityBase::get public function Returns the value of a property. Overrides ConfigEntityInterface::get
ConfigEntityBase::getCacheTagsToInvalidate public function Returns the cache tags that should be used to invalidate caches. Overrides EntityBase::getCacheTagsToInvalidate 1
ConfigEntityBase::getConfigDependencyName public function Gets the configuration dependency name. Overrides EntityBase::getConfigDependencyName
ConfigEntityBase::getConfigManager protected static function Gets the configuration manager.
ConfigEntityBase::getConfigTarget public function Gets the configuration target identifier for the entity. Overrides EntityBase::getConfigTarget
ConfigEntityBase::getDependencies public function Gets the configuration dependencies. Overrides ConfigEntityInterface::getDependencies
ConfigEntityBase::getOriginalId public function Gets the original ID. Overrides EntityBase::getOriginalId
ConfigEntityBase::getThirdPartyProviders public function Gets the list of third parties that store information. Overrides ThirdPartySettingsInterface::getThirdPartyProviders
ConfigEntityBase::getThirdPartySetting public function Gets the value of a third-party setting. Overrides ThirdPartySettingsInterface::getThirdPartySetting
ConfigEntityBase::getThirdPartySettings public function Gets all third-party settings of a given module. Overrides ThirdPartySettingsInterface::getThirdPartySettings
ConfigEntityBase::getTypedConfig protected function Gets the typed config manager.
ConfigEntityBase::hasTrustedData public function Gets whether on not the data is trusted. Overrides ConfigEntityInterface::hasTrustedData
ConfigEntityBase::invalidateTagsOnDelete protected static function Override to never invalidate the individual entities' cache tags; the config system already invalidates them. Overrides EntityBase::invalidateTagsOnDelete
ConfigEntityBase::invalidateTagsOnSave protected function Override to never invalidate the entity's cache tag; the config system already invalidates it. Overrides EntityBase::invalidateTagsOnSave
ConfigEntityBase::isInstallable public function Checks whether this entity is installable. Overrides ConfigEntityInterface::isInstallable 2
ConfigEntityBase::isNew public function Overrides Entity::isNew(). Overrides EntityBase::isNew
ConfigEntityBase::isUninstalling public function Returns whether this entity is being changed during the uninstall process. Overrides ConfigEntityInterface::isUninstalling
ConfigEntityBase::link public function Deprecated way of generating a link to the entity. See toLink(). Overrides EntityBase::link
ConfigEntityBase::onDependencyRemoval public function Informs the entity that entities it depends on will be deleted. Overrides ConfigEntityInterface::onDependencyRemoval 7
ConfigEntityBase::preDelete public static function Acts on entities before they are deleted and before hooks are invoked. Overrides EntityBase::preDelete 8
ConfigEntityBase::preSave public function Acts on an entity before the presave hook is invoked. Overrides EntityBase::preSave 13
ConfigEntityBase::save public function Saves an entity permanently. Overrides EntityBase::save 1
ConfigEntityBase::set public function Sets the value of a property. Overrides ConfigEntityInterface::set
ConfigEntityBase::setOriginalId public function Sets the original ID. Overrides EntityBase::setOriginalId
ConfigEntityBase::setStatus public function Sets the status of the configuration entity. Overrides ConfigEntityInterface::setStatus
ConfigEntityBase::setThirdPartySetting public function Sets the value of a third-party setting. Overrides ThirdPartySettingsInterface::setThirdPartySetting
ConfigEntityBase::setUninstalling public function
ConfigEntityBase::sort public static function Helper callback for uasort() to sort configuration entities by weight and label. 6
ConfigEntityBase::toArray public function Gets an array of all property values. Overrides EntityBase::toArray 2
ConfigEntityBase::toUrl public function Gets the URL object for the entity. Overrides EntityBase::toUrl
ConfigEntityBase::trustData public function Sets that the data should be trusted. Overrides ConfigEntityInterface::trustData
ConfigEntityBase::unsetThirdPartySetting public function Unsets a third-party setting. Overrides ThirdPartySettingsInterface::unsetThirdPartySetting
ConfigEntityBase::url public function Gets the public URL for this entity. Overrides EntityBase::url
ConfigEntityBase::urlInfo public function Gets the URL object for the entity. Overrides EntityBase::urlInfo
ConfigEntityBase::__construct public function Constructs an Entity object. Overrides EntityBase::__construct 10
ConfigEntityBase::__sleep public function Overrides EntityBase::__sleep 4
DependencySerializationTrait::$_entityStorages protected property An array of entity type IDs keyed by the property name of their storages.
DependencySerializationTrait::$_serviceIds protected property An array of service IDs keyed by property name used for serialization.
DependencySerializationTrait::__sleep public function Aliased as: traitSleep 1
DependencySerializationTrait::__wakeup public function 2
DependencyTrait::$dependencies protected property The object's dependencies.
DependencyTrait::addDependencies protected function Adds multiple dependencies.
DependencyTrait::addDependency protected function Adds a dependency. Aliased as: addDependencyTrait
EntityBase::$enforceIsNew protected property Boolean indicating whether the entity should be forced to be new.
EntityBase::$entityTypeId protected property The entity type.
EntityBase::$typedData protected property A typed data object wrapping this entity.
EntityBase::access public function Checks data value access. Overrides AccessibleInterface::access 1
EntityBase::bundle public function Gets the bundle of the entity. Overrides EntityInterface::bundle 1
EntityBase::create public static function Constructs a new entity object, without permanently saving it. Overrides EntityInterface::create
EntityBase::delete public function Deletes an entity permanently. Overrides EntityInterface::delete 2
EntityBase::enforceIsNew public function Enforces an entity to be new. Overrides EntityInterface::enforceIsNew
EntityBase::entityManager Deprecated protected function Gets the entity manager.
EntityBase::entityTypeBundleInfo protected function Gets the entity type bundle info service.
EntityBase::entityTypeManager protected function Gets the entity type manager.
EntityBase::getCacheContexts public function The cache contexts associated with this object. Overrides CacheableDependencyTrait::getCacheContexts
EntityBase::getCacheMaxAge public function The maximum age for which this object may be cached. Overrides CacheableDependencyTrait::getCacheMaxAge
EntityBase::getCacheTags public function The cache tags associated with this object. Overrides CacheableDependencyTrait::getCacheTags
EntityBase::getConfigDependencyKey public function Gets the key that is used to store configuration dependencies. Overrides EntityInterface::getConfigDependencyKey
EntityBase::getEntityType public function Gets the entity type definition. Overrides EntityInterface::getEntityType
EntityBase::getEntityTypeId public function Gets the ID of the type of the entity. Overrides EntityInterface::getEntityTypeId
EntityBase::getListCacheTagsToInvalidate protected function The list cache tags to invalidate for this entity.
EntityBase::getTypedData public function Gets a typed data object for this entity object. Overrides EntityInterface::getTypedData
EntityBase::hasLinkTemplate public function Indicates if a link template exists for a given key. Overrides EntityInterface::hasLinkTemplate
EntityBase::id public function Gets the identifier. Overrides EntityInterface::id 11
EntityBase::label public function Gets the label of the entity. Overrides EntityInterface::label 6
EntityBase::language public function Gets the language of the entity. Overrides EntityInterface::language 1
EntityBase::languageManager protected function Gets the language manager.
EntityBase::linkTemplates protected function Gets an array link templates. 1
EntityBase::load public static function Loads an entity. Overrides EntityInterface::load
EntityBase::loadMultiple public static function Loads one or more entities. Overrides EntityInterface::loadMultiple
EntityBase::postCreate public function Acts on a created entity before hooks are invoked. Overrides EntityInterface::postCreate 4
EntityBase::postDelete public static function Acts on deleted entities before the delete hook is invoked. Overrides EntityInterface::postDelete 16
EntityBase::postLoad public static function Acts on loaded entities. Overrides EntityInterface::postLoad 2
EntityBase::postSave public function Acts on a saved entity before the insert or update hook is invoked. Overrides EntityInterface::postSave 14
EntityBase::preCreate public static function Changes the values of an entity before it is created. Overrides EntityInterface::preCreate 5
EntityBase::referencedEntities public function Gets a list of entities referenced by this entity. Overrides EntityInterface::referencedEntities 1
EntityBase::toLink public function Generates the HTML for a link to this entity. Overrides EntityInterface::toLink
EntityBase::uriRelationships public function Gets a list of URI relationships supported by this entity. Overrides EntityInterface::uriRelationships
EntityBase::urlRouteParameters protected function Gets an array of placeholders for this entity. 2
EntityBase::uuid public function Gets the entity UUID (Universally Unique Identifier). Overrides EntityInterface::uuid 1
EntityBase::uuidGenerator protected function Gets the UUID generator.
FormsSteps::$description protected property The description of the FormsSteps, which is used only in the interface.
FormsSteps::$id public property The unique ID of the Forms Steps.
FormsSteps::$label protected property The label of the FormsSteps.
FormsSteps::$progress_steps protected property The ordered FormsSteps progress steps.
FormsSteps::$progress_steps_links_saved_only protected property The progress_steps_links_saved_only setting of the FormsSteps.
FormsSteps::$progress_steps_links_saved_only_next protected property The progress_steps_links_saved_only_next setting of the FormsSteps.
FormsSteps::$redirection_policy protected property The redirection policy of the FormsSteps.
FormsSteps::$redirection_target protected property The redirection target of the FormsSteps.
FormsSteps::$steps protected property The ordered FormsSteps steps.
FormsSteps::addProgressStep public function Adds a progress step to the forms_steps. Overrides FormsStepsInterface::addProgressStep
FormsSteps::addStep public function Adds a step to the forms_steps. Overrides FormsStepsInterface::addStep
FormsSteps::deleteProgressStep public function Deletes a progress step from the forms_steps. Overrides FormsStepsInterface::deleteProgressStep
FormsSteps::deleteStep public function Deletes a step from the forms_steps. Overrides FormsStepsInterface::deleteStep
FormsSteps::ENTITY_TYPE constant Entity type id.
FormsSteps::getDescription public function Returns the description.
FormsSteps::getFirstStep public function Retrieve the first step defined on a forms steps entity. Overrides FormsStepsInterface::getFirstStep
FormsSteps::getLastStep public function Retrieve the last step defined on a forms steps entity. Overrides FormsStepsInterface::getLastStep
FormsSteps::getNextStep public function Returns the next step to $step. Overrides FormsStepsInterface::getNextStep
FormsSteps::getNextStepRoute public function Returns the next step route. Overrides FormsStepsInterface::getNextStepRoute
FormsSteps::getNextWeight protected function Gets the weight for a new step or progress step.
FormsSteps::getPreviousStep public function Returns the previous step to $step. Overrides FormsStepsInterface::getPreviousStep
FormsSteps::getPreviousStepRoute public function Returns the previous step route.
FormsSteps::getProgressStep public function Gets a forms_steps progress step. Overrides FormsStepsInterface::getProgressStep
FormsSteps::getProgressSteps public function Gets progress step objects for the provided progress step IDs. Overrides FormsStepsInterface::getProgressSteps
FormsSteps::getProgressStepsLinksSavedOnly public function Returns the Progress steps links saved only setting.
FormsSteps::getProgressStepsLinksSavedOnlyNext public function Returns the Progress steps links saved only next setting.
FormsSteps::getRedirectionPolicy public function Returns the redirection policy.
FormsSteps::getRedirectionTarget public function Returns the redirection target.
FormsSteps::getStep public function Gets a forms_steps step. Overrides FormsStepsInterface::getStep
FormsSteps::getStepRoute public function Returns the current step route. Overrides FormsStepsInterface::getStepRoute
FormsSteps::getSteps public function Gets step objects for the provided step IDs. Overrides FormsStepsInterface::getSteps
FormsSteps::hasProgressStep public function Determines if the forms_steps has a progress step with the provided ID. Overrides FormsStepsInterface::hasProgressStep
FormsSteps::hasStep public function Determines if the forms_steps has a step with the provided ID. Overrides FormsStepsInterface::hasStep
FormsSteps::setProgressStepActiveRoutes public function Sets the progress step's active routes. Overrides FormsStepsInterface::setProgressStepActiveRoutes
FormsSteps::setProgressStepLabel public function Sets a progress step's label. Overrides FormsStepsInterface::setProgressStepLabel
FormsSteps::setProgressStepLink public function Sets a progress step's link. Overrides FormsStepsInterface::setProgressStepLink
FormsSteps::setProgressStepLinkVisibility public function Sets a progress step's link visibility. Overrides FormsStepsInterface::setProgressStepLinkVisibility
FormsSteps::setProgressStepWeight public function
FormsSteps::setStepCancelLabel public function Sets a step's cancel label. Overrides FormsStepsInterface::setStepCancelLabel
FormsSteps::setStepCancelRoute public function Sets a step's cancel route. Overrides FormsStepsInterface::setStepCancelRoute
FormsSteps::setStepCancelStep public function Sets a step's cancel step. Overrides FormsStepsInterface::setStepCancelStep
FormsSteps::setStepCancelStepMode public function Sets a step's cancel step mode. Overrides FormsStepsInterface::setStepCancelStepMode
FormsSteps::setStepDeleteLabel public function Set the label of the delete button of the step. Overrides FormsStepsInterface::setStepDeleteLabel
FormsSteps::setStepDeleteState public function Set the delete state (hidden or shown) of the step. Overrides FormsStepsInterface::setStepDeleteState
FormsSteps::setStepEntityBundle public function Sets a step's Entity bundle. Overrides FormsStepsInterface::setStepEntityBundle
FormsSteps::setStepEntityType public function Sets a step's Entity type. Overrides FormsStepsInterface::setStepEntityType
FormsSteps::setStepFormMode public function Sets a step's form mode value. Overrides FormsStepsInterface::setStepFormMode
FormsSteps::setStepLabel public function Sets a step's label. Overrides FormsStepsInterface::setStepLabel
FormsSteps::setStepPreviousLabel public function Set the label of the previous button of the step. Overrides FormsStepsInterface::setStepPreviousLabel
FormsSteps::setStepPreviousState public function Set the previous state (hidden or displayed) of the step. Overrides FormsStepsInterface::setStepPreviousState
FormsSteps::setStepSubmitLabel public function Sets a step's submit label. Overrides FormsStepsInterface::setStepSubmitLabel
FormsSteps::setStepUrl public function Sets a step's URL value. Overrides FormsStepsInterface::setStepUrl
FormsSteps::setStepWeight public function Sets a step's weight value. Overrides FormsStepsInterface::setStepWeight
FormsSteps::status public function Returns whether the configuration entity is enabled. Overrides ConfigEntityBase::status
PluginDependencyTrait::calculatePluginDependencies protected function Calculates and adds dependencies of a specific plugin instance. 1
PluginDependencyTrait::getPluginDependencies protected function Calculates and returns dependencies of a specific plugin instance.
PluginDependencyTrait::moduleHandler protected function Wraps the module handler. 1
PluginDependencyTrait::themeHandler protected function Wraps the theme handler. 1
RefinableCacheableDependencyTrait::addCacheableDependency public function 1
RefinableCacheableDependencyTrait::addCacheContexts public function
RefinableCacheableDependencyTrait::addCacheTags public function
RefinableCacheableDependencyTrait::mergeCacheMaxAge public function
SynchronizableEntityTrait::$isSyncing protected property Whether this entity is being created, updated or deleted through a synchronization process.
SynchronizableEntityTrait::isSyncing public function
SynchronizableEntityTrait::setSyncing public function