You are here

class PageVariant in Page Manager 8.4

Same name and namespace in other branches
  1. 8 src/Entity/PageVariant.php \Drupal\page_manager\Entity\PageVariant

Defines the page variant entity.

Plugin annotation


@ConfigEntityType(
  id = "page_variant",
  label = @Translation("Page Variant"),
  handlers = {
    "view_builder" = "Drupal\page_manager\Entity\PageVariantViewBuilder",
    "access" = "Drupal\page_manager\Entity\PageVariantAccess",
  },
  admin_permission = "administer pages",
  entity_keys = {
    "id" = "id",
    "label" = "label",
    "uuid" = "uuid"
  },
  config_export = {
    "id",
    "label",
    "uuid",
    "variant",
    "variant_settings",
    "page",
    "weight",
    "selection_criteria",
    "selection_logic",
    "static_context",
  },
  lookup_keys = {
    "page"
  }
)

Hierarchy

Expanded class hierarchy of PageVariant

14 files declare their use of PageVariant
FrontPageTest.php in tests/src/Functional/FrontPageTest.php
PageConfigSchemaTest.php in tests/src/Kernel/PageConfigSchemaTest.php
PageManagerAdminTest.php in page_manager_ui/tests/src/Functional/PageManagerAdminTest.php
PageManagerConfigTranslationTest.php in tests/src/Functional/PageManagerConfigTranslationTest.php
PageManagerRoutingTest.php in tests/src/Kernel/PageManagerRoutingTest.php

... See full list

File

src/Entity/PageVariant.php, line 47

Namespace

Drupal\page_manager\Entity
View source
class PageVariant extends ConfigEntityBase implements PageVariantInterface {

  /**
   * The ID of the page variant entity.
   *
   * @var string
   */
  protected $id;

  /**
   * The label of the page variant entity.
   *
   * @var string
   */
  protected $label;

  /**
   * The weight of the page variant entity.
   *
   * @var int
   */
  protected $weight = 0;

  /**
   * The UUID of the page variant entity.
   *
   * @var string
   */
  protected $uuid;

  /**
   * The ID of the variant plugin.
   *
   * @var string
   */
  protected $variant;

  /**
   * The plugin configuration for the variant plugin.
   *
   * @var array
   */
  protected $variant_settings = [];

  /**
   * The ID of the page entity this page variant entity belongs to.
   *
   * @var string
   */
  protected $page;

  /**
   * The loaded page entity this page variant entity belongs to.
   *
   * @var \Drupal\page_manager\PageInterface
   */
  protected $pageEntity;

  /**
   * The plugin configuration for the selection criteria condition plugins.
   *
   * @var array
   */
  protected $selection_criteria = [];

  /**
   * The selection logic for this page variant entity (either 'and' or 'or').
   *
   * @var string
   */
  protected $selection_logic = 'and';

  /**
   * An array of collected contexts.
   *
   * @var \Drupal\Component\Plugin\Context\ContextInterface[]|null
   */
  protected $contexts = NULL;

  /**
   * Static context references.
   *
   * A list of arrays with the keys name, label, type and value.
   *
   * @var array[]
   */
  protected $static_context = [];

  /**
   * The plugin collection that holds the single variant plugin instance.
   *
   * @var \Drupal\Core\Plugin\DefaultSingleLazyPluginCollection
   */
  protected $variantPluginCollection;

  /**
   * The plugin collection that holds the selection condition plugins.
   *
   * @var \Drupal\Component\Plugin\LazyPluginCollection
   */
  protected $selectionConditionCollection;

  /**
   * {@inheritdoc}
   */
  protected function invalidateTagsOnSave($update) {
    parent::invalidateTagsOnSave($update);

    // The parent doesn't invalidate the entity cache tags on save because the
    // config system will invalidate them, but since we're using the parent
    // page's cache tags, we need to invalidate them special.
    Cache::invalidateTags($this
      ->getCacheTagsToInvalidate());
  }

  /**
   * {@inheritdoc}
   */
  protected static function invalidateTagsOnDelete(EntityTypeInterface $entity_type, array $entities) {
    parent::invalidateTagsOnDelete($entity_type, $entities);

    // The parent doesn't invalidate the entity cache tags on delete because the
    // config system will invalidate them, but since we're using the parent
    // page's cache tags, we need to invalidate them special.
    $tags = [];
    foreach ($entities as $entity) {
      $tags = Cache::mergeTags($tags, $entity
        ->getCacheTagsToInvalidate());
    }
    Cache::invalidateTags($tags);
  }

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

    // We use the same cache tags as the parent page.
    return $this
      ->getPage()
      ->getCacheTagsToInvalidate();
  }

  /**
   * {@inheritdoc}
   */
  public function calculateDependencies() {
    parent::calculateDependencies();
    $this
      ->addDependency('config', $this
      ->getPage()
      ->getConfigDependencyName());
    foreach ($this
      ->getSelectionConditions() as $instance) {
      $this
        ->calculatePluginDependencies($instance);
    }
    return $this
      ->getDependencies();
  }

  /**
   * {@inheritdoc}
   */
  public function getPluginCollections() {
    return [
      'selection_criteria' => $this
        ->getSelectionConditions(),
      'variant_settings' => $this
        ->getVariantPluginCollection(),
    ];
  }

  /**
   * Get the plugin collection that holds the single variant plugin instance.
   *
   * @return \Drupal\Core\Plugin\DefaultSingleLazyPluginCollection
   *   The plugin collection that holds the single variant plugin instance.
   */
  protected function getVariantPluginCollection() {
    if (!$this->variantPluginCollection) {
      if (empty($this->variant_settings['uuid'])) {
        $this->variant_settings['uuid'] = $this
          ->uuidGenerator()
          ->generate();
      }
      $this->variantPluginCollection = new DefaultSingleLazyPluginCollection(\Drupal::service('plugin.manager.display_variant'), $this->variant, $this->variant_settings);
    }
    return $this->variantPluginCollection;
  }

  /**
   * {@inheritdoc}
   */
  public function getVariantPlugin() {
    return $this
      ->getVariantPluginCollection()
      ->get($this->variant);
  }

  /**
   * {@inheritdoc}
   */
  public function getVariantPluginId() {
    return $this->variant;
  }

  /**
   * {@inheritdoc}
   */
  public function setVariantPluginId($variant) {
    $this->variant = $variant;
    return $this;
  }

  /**
   * {@inheritdoc}
   */
  public function getPage() {
    if (!$this->pageEntity) {
      if (!$this->page) {
        throw new \UnexpectedValueException('The page variant has no associated page');
      }
      $this->pageEntity = $this
        ->getPageStorage()
        ->load($this->page);
      if (!$this->pageEntity) {
        throw new \UnexpectedValueException(sprintf('The page %s could not be loaded', $this->page));
      }
    }
    return $this->pageEntity;
  }

  /**
   * {@inheritdoc}
   */
  public function setPageEntity(PageInterface $page) {
    $this->pageEntity = $page;
    $this->page = $page
      ->id();
    return $this;
  }

  /**
   * {@inheritdoc}
   */
  public function getContexts() {
    if (is_null($this->contexts)) {
      $static_contexts = $this
        ->getContextMapper()
        ->getContextValues($this
        ->getStaticContexts());
      $page_contexts = $this
        ->getPage()
        ->getContexts();
      $this->contexts = $page_contexts + $static_contexts;
    }
    return $this->contexts;
  }

  /**
   * {@inheritdoc}
   */
  public function resetCollectedContexts() {
    $this->contexts = NULL;
    return $this;
  }

  /**
   * {@inheritdoc}
   */
  public function getWeight() {
    return $this->weight;
  }

  /**
   * {@inheritdoc}
   */
  public function setWeight($weight) {
    $this->weight = $weight;
    return $this;
  }

  /**
   * {@inheritdoc}
   */
  public function getSelectionLogic() {
    return $this
      ->get('selection_logic');
  }

  /**
   * {@inheritdoc}
   */
  protected function getSelectionConfiguration() {
    return $this
      ->get('selection_criteria');
  }

  /**
   * {@inheritdoc}
   */
  public function getSelectionConditions() {
    if (!$this->selectionConditionCollection) {
      $this->selectionConditionCollection = new ConditionPluginCollection($this
        ->getConditionManager(), $this
        ->getSelectionConfiguration());
    }
    return $this->selectionConditionCollection;
  }

  /**
   * {@inheritdoc}
   */
  public function addSelectionCondition(array $configuration) {
    $configuration['uuid'] = $this
      ->uuidGenerator()
      ->generate();
    $this
      ->getSelectionConditions()
      ->addInstanceId($configuration['uuid'], $configuration);
    return $configuration['uuid'];
  }

  /**
   * {@inheritdoc}
   */
  public function getSelectionCondition($condition_id) {
    return $this
      ->getSelectionConditions()
      ->get($condition_id);
  }

  /**
   * {@inheritdoc}
   */
  public function removeSelectionCondition($condition_id) {
    $this
      ->getSelectionConditions()
      ->removeInstanceId($condition_id);
    return $this;
  }

  /**
   * {@inheritdoc}
   */
  public function getStaticContexts() {
    return $this->static_context;
  }

  /**
   * {@inheritdoc}
   */
  public function getStaticContext($name) {
    if (isset($this->static_context[$name])) {
      return $this->static_context[$name];
    }
    return [];
  }

  /**
   * {@inheritdoc}
   */
  public function setStaticContext($name, $configuration) {
    $this->static_context[$name] = $configuration;
    $this
      ->resetCollectedContexts();
    return $this;
  }

  /**
   * {@inheritdoc}
   */
  public function removeStaticContext($name) {
    unset($this->static_context[$name]);
    $this
      ->resetCollectedContexts();
    return $this;
  }

  /**
   * {@inheritdoc}
   */
  protected function urlRouteParameters($rel) {
    $parameters = parent::urlRouteParameters($rel);
    $parameters['page'] = $this
      ->get('page');
    return $parameters;
  }

  /**
   * {@inheritdoc}
   */
  public function postSave(EntityStorageInterface $storage, $update = TRUE) {
    parent::postSave($storage, $update);
    static::routeBuilder()
      ->setRebuildNeeded();
  }

  /**
   * {@inheritdoc}
   */
  public static function postDelete(EntityStorageInterface $storage, array $entities) {
    parent::postDelete($storage, $entities);
    static::routeBuilder()
      ->setRebuildNeeded();
  }

  /**
   * Wraps the route builder.
   *
   * @return \Drupal\Core\Routing\RouteBuilderInterface
   *   An object for state storage.
   */
  protected static function routeBuilder() {
    return \Drupal::service('router.builder');
  }

  /**
   * Wraps the condition plugin manager.
   *
   * @return \Drupal\Core\Condition\ConditionManager
   *   The condition manager service.
   */
  protected function getConditionManager() {
    return \Drupal::service('plugin.manager.condition');
  }

  /**
   * Wraps the context mapper.
   *
   * @return \Drupal\page_manager\ContextMapperInterface
   *   The context mapper service.
   */
  protected function getContextMapper() {
    return \Drupal::service('page_manager.context_mapper');
  }

  /**
   * Wraps the page entity storage.
   *
   * @return \Drupal\Core\Entity\EntityStorageInterface
   *   The Page entity storage service.
   */
  protected function getPageStorage() {
    return \Drupal::entityTypeManager()
      ->getStorage('page');
  }

  /**
   * {@inheritdoc}
   */
  public function __sleep() {
    $vars = parent::__sleep();

    // Gathered contexts objects should not be serialized.
    if (($key = array_search('contexts', $vars)) !== FALSE) {
      unset($vars[$key]);
    }
    return $vars;
  }

}

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::$_core protected property Information maintained by Drupal core about configuration.
ConfigEntityBase::addDependency protected function Overrides \Drupal\Core\Entity\DependencyTrait:addDependency().
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::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::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::status public function Returns whether the configuration entity is enabled. Overrides ConfigEntityInterface::status 4
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
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::postLoad public static function Acts on loaded entities. Overrides EntityInterface::postLoad 2
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::uuid public function Gets the entity UUID (Universally Unique Identifier). Overrides EntityInterface::uuid 1
EntityBase::uuidGenerator protected function Gets the UUID generator.
PageVariant::$contexts protected property An array of collected contexts.
PageVariant::$id protected property The ID of the page variant entity.
PageVariant::$label protected property The label of the page variant entity.
PageVariant::$page protected property The ID of the page entity this page variant entity belongs to.
PageVariant::$pageEntity protected property The loaded page entity this page variant entity belongs to.
PageVariant::$selectionConditionCollection protected property The plugin collection that holds the selection condition plugins.
PageVariant::$selection_criteria protected property The plugin configuration for the selection criteria condition plugins.
PageVariant::$selection_logic protected property The selection logic for this page variant entity (either 'and' or 'or').
PageVariant::$static_context protected property Static context references.
PageVariant::$uuid protected property The UUID of the page variant entity. Overrides ConfigEntityBase::$uuid
PageVariant::$variant protected property The ID of the variant plugin.
PageVariant::$variantPluginCollection protected property The plugin collection that holds the single variant plugin instance.
PageVariant::$variant_settings protected property The plugin configuration for the variant plugin.
PageVariant::$weight protected property The weight of the page variant entity.
PageVariant::addSelectionCondition public function Adds selection criteria. Overrides PageVariantInterface::addSelectionCondition
PageVariant::calculateDependencies public function Calculates dependencies and stores them in the dependency property. Overrides ConfigEntityBase::calculateDependencies
PageVariant::getCacheTagsToInvalidate public function Returns the cache tags that should be used to invalidate caches. Overrides ConfigEntityBase::getCacheTagsToInvalidate
PageVariant::getConditionManager protected function Wraps the condition plugin manager.
PageVariant::getContextMapper protected function Wraps the context mapper.
PageVariant::getContexts public function Gets the values for all defined contexts. Overrides PageVariantInterface::getContexts
PageVariant::getPage public function Gets the page this variant is on. Overrides PageVariantInterface::getPage
PageVariant::getPageStorage protected function Wraps the page entity storage.
PageVariant::getPluginCollections public function Gets the plugin collections used by this object. Overrides ObjectWithPluginCollectionInterface::getPluginCollections
PageVariant::getSelectionCondition public function Gets selection criteria by condition id. Overrides PageVariantInterface::getSelectionCondition
PageVariant::getSelectionConditions public function Gets the selection condition collection. Overrides PageVariantInterface::getSelectionConditions
PageVariant::getSelectionConfiguration protected function
PageVariant::getSelectionLogic public function Gets the selection logic used by the criteria (ie. "and" or "or"). Overrides PageVariantInterface::getSelectionLogic
PageVariant::getStaticContext public function Retrieves a specific static context. Overrides PageVariantInterface::getStaticContext
PageVariant::getStaticContexts public function Returns the static context configurations for this page entity. Overrides PageVariantInterface::getStaticContexts
PageVariant::getVariantPlugin public function Gets the variant plugin. Overrides PageVariantInterface::getVariantPlugin
PageVariant::getVariantPluginCollection protected function Get the plugin collection that holds the single variant plugin instance.
PageVariant::getVariantPluginId public function Gets the plugin ID of the variant plugin. Overrides PageVariantInterface::getVariantPluginId
PageVariant::getWeight public function Gets the weight of this variant (compared to other variants on the page). Overrides PageVariantInterface::getWeight
PageVariant::invalidateTagsOnDelete protected static function Override to never invalidate the individual entities' cache tags; the config system already invalidates them. Overrides ConfigEntityBase::invalidateTagsOnDelete
PageVariant::invalidateTagsOnSave protected function Override to never invalidate the entity's cache tag; the config system already invalidates it. Overrides ConfigEntityBase::invalidateTagsOnSave
PageVariant::postDelete public static function Acts on deleted entities before the delete hook is invoked. Overrides EntityBase::postDelete
PageVariant::postSave public function Acts on a saved entity before the insert or update hook is invoked. Overrides EntityBase::postSave
PageVariant::removeSelectionCondition public function Removes selection criteria by condition id. Overrides PageVariantInterface::removeSelectionCondition
PageVariant::removeStaticContext public function Removes a specific static context. Overrides PageVariantInterface::removeStaticContext
PageVariant::resetCollectedContexts public function Resets the collected contexts. Overrides PageVariantInterface::resetCollectedContexts
PageVariant::routeBuilder protected static function Wraps the route builder.
PageVariant::setPageEntity public function Sets the page with a full entity object. Overrides PageVariantInterface::setPageEntity
PageVariant::setStaticContext public function Adds/updates a given static context. Overrides PageVariantInterface::setStaticContext
PageVariant::setVariantPluginId public function Sets the plugin ID of the variant plugin without loading the Plugin collections. Overrides PageVariantInterface::setVariantPluginId
PageVariant::setWeight public function Sets the weight of this variant (compared to other variants on the page). Overrides PageVariantInterface::setWeight
PageVariant::urlRouteParameters protected function Gets an array of placeholders for this entity. Overrides EntityBase::urlRouteParameters
PageVariant::__sleep public function Overrides ConfigEntityBase::__sleep
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