You are here

class Pool in CMS Content Sync 8

Same name in this branch
  1. 8 src/Entity/Pool.php \Drupal\cms_content_sync\Entity\Pool
  2. 8 modules/cms_content_sync_views/src/Plugin/views/filter/Pool.php \Drupal\cms_content_sync_views\Plugin\views\filter\Pool
Same name and namespace in other branches
  1. 2.1.x src/Entity/Pool.php \Drupal\cms_content_sync\Entity\Pool
  2. 2.0.x src/Entity/Pool.php \Drupal\cms_content_sync\Entity\Pool

Defines the "Content Sync - Pool" entity.

Plugin annotation


@ConfigEntityType(
  id = "cms_content_sync_pool",
  label = @Translation("Content Sync - Pool"),
  handlers = {
    "list_builder" = "Drupal\cms_content_sync\Controller\PoolListBuilder",
    "form" = {
      "add" = "Drupal\cms_content_sync\Form\PoolForm",
      "edit" = "Drupal\cms_content_sync\Form\PoolForm",
      "delete" = "Drupal\cms_content_sync\Form\PoolDeleteForm",
    }
  },
  config_prefix = "pool",
  admin_permission = "administer cms content sync",
  entity_keys = {
    "id" = "id",
    "label" = "label",
  },
  config_export = {
    "id",
    "label",
    "backend_url",
  },
  links = {
    "edit-form" = "/admin/config/services/cms_content_sync/pool/{cms_content_sync_pool}/edit",
    "delete-form" = "/admin/config/services/cms_content_sync/synchronizations/{cms_content_sync_pool}/delete",
  }
)

Hierarchy

Expanded class hierarchy of Pool

24 files declare their use of Pool
CliService.php in src/Cli/CliService.php
cms_content_sync.install in ./cms_content_sync.install
Install file for cms_content_sync.
cms_content_sync.module in ./cms_content_sync.module
Module file for cms_content_sync.
ContentSyncSettings.php in src/Controller/ContentSyncSettings.php
CopyRemoteFlow.php in src/Form/CopyRemoteFlow.php

... See full list

4 string references to 'Pool'
cms_content_sync_views_data_alter in modules/cms_content_sync_views/cms_content_sync_views.module
Implements hook_views_data_alter().
DebugForm::inspectEntity in src/Form/DebugForm.php
Display debug output for a given entity to analyze it's sync structure.
PoolAssignmentForm::buildForm in src/Form/PoolAssignmentForm.php
Form constructor.
views.view.content_sync_entity_status.yml in modules/cms_content_sync_health/config/install/views.view.content_sync_entity_status.yml
modules/cms_content_sync_health/config/install/views.view.content_sync_entity_status.yml

File

src/Entity/Pool.php, line 46

Namespace

Drupal\cms_content_sync\Entity
View source
class Pool extends ConfigEntityBase implements PoolInterface {

  /**
   * @var string POOL_USAGE_FORBID Forbid usage of this pool for this flow
   */
  public const POOL_USAGE_FORBID = 'forbid';

  /**
   * @var string POOL_USAGE_ALLOW Allow usage of this pool for this flow
   */
  public const POOL_USAGE_ALLOW = 'allow';

  /**
   * @var string POOL_USAGE_FORCE Force usage of this pool for this flow
   */
  public const POOL_USAGE_FORCE = 'force';

  /**
   * The Pool ID.
   *
   * @var string
   */
  public $id;

  /**
   * The Pool label.
   *
   * @var string
   */
  public $label;

  /**
   * The Pool Sync Core backend URL.
   *
   * @var string
   */
  public $backend_url;

  /**
   * The authentication type to use.
   * See Pool::AUTHENTICATION_TYPE_* for details.
   *
   * @deprecated Will be removed with the 2.0 release.
   *
   * @var string
   */
  public $authentication_type;

  /**
   * The unique site identifier.
   *
   * @deprecated Will be removed with the 2.0 release.
   *
   * @var string
   */
  public $site_id;

  /**
   * @var \EdgeBox\SyncCore\V1\SyncCore
   */
  protected $client;

  /**
   * @return \EdgeBox\SyncCore\Interfaces\ISyncCore
   */
  public function getClient() {
    if (!$this->client) {
      $this->client = SyncCoreFactory::getSyncCore($this
        ->getSyncCoreUrl());
    }
    return $this->client;
  }

  /**
   * {@inheritdoc}
   */
  public static function preDelete(EntityStorageInterface $storage, array $entities) {
    parent::preDelete($storage, $entities);
    try {
      foreach ($entities as $entity) {
        $handler = new SyncCorePoolExport($entity);

        // $handler->remove(FALSE);
      }
    } catch (RequestException $e) {
      $messenger = \Drupal::messenger();
      $messenger
        ->addError(t('The Sync Core server could not be accessed. Please check the connection.'));
      throw new AccessDeniedHttpException();
    }
  }

  /**
   * Get a list of all sites from all pools that use a different version ID and
   * provide a diff on field basis.
   *
   * @param string $entity_type
   * @param string $bundle
   *
   * @throws \Exception
   *
   * @return array pool => site_id[]
   */
  public static function getAllSitesWithDifferentEntityTypeVersion($entity_type, $bundle) {
    $result = [];
    foreach (Pool::getAll() as $pool_id => $pool) {
      $diff = $pool
        ->getClient()
        ->getSitesWithDifferentEntityTypeVersion($pool->id, $entity_type, $bundle, Flow::getEntityTypeVersion($entity_type, $bundle));
      if (empty($diff)) {
        continue;
      }
      $result[$pool_id] = $diff;
    }
    return $result;
  }

  /**
   * Get a list of all sites for all pools that are using this entity.
   * Only works for pools that are connected to the entity on this site.
   *
   * @param \Drupal\Core\Entity\EntityInterface $entity
   *
   * @throws \Exception
   * @throws \GuzzleHttp\Exception\GuzzleException
   *
   * @return array pool => site_id[]
   */
  public static function getAllExternalUsages($entity) {
    $entity_type = $entity
      ->getEntityTypeId();
    $bundle = $entity
      ->bundle();
    $entity_uuid = $entity
      ->uuid();
    $result = [];
    foreach (EntityStatus::getInfosForEntity($entity_type, $entity_uuid) as $status) {
      $pool = $status
        ->getPool();
      if (empty($pool)) {
        continue;
      }
      $pool_id = $pool->id;
      if (isset($result[$pool_id])) {
        continue;
      }
      if ($entity instanceof ConfigEntityInterface) {
        $shared_entity_id = $entity
          ->id();
      }
      else {
        $shared_entity_id = $entity_uuid;
      }
      $result[$pool_id] = $pool
        ->getClient()
        ->getSyndicationService()
        ->getExternalUsages($pool_id, $entity_type, $bundle, $shared_entity_id);
    }
    return $result;
  }

  /**
   * Returns the Sync Core URL for this pool.
   *
   * @return string
   */
  public function getSyncCoreUrl() {

    // Check if the BackendUrl got overwritten.
    $cms_content_sync_settings = Settings::get('cms_content_sync');
    if (isset($cms_content_sync_settings, $cms_content_sync_settings['pools'][$this->id]['backend_url'])) {
      return $cms_content_sync_settings['pools'][$this->id]['backend_url'];
    }
    return $this->backend_url;
  }

  /**
   * Get the newest pull/push timestamp for this pool from all status
   * entities that exist for the given entity.
   *
   * @param $entity_type
   * @param $entity_uuid
   * @param bool $pull
   *
   * @return null|int
   */
  public function getNewestTimestamp($entity_type, $entity_uuid, $pull = true) {
    $entity_status = EntityStatus::getInfoForPool($entity_type, $entity_uuid, $this);
    $timestamp = null;
    foreach ($entity_status as $info) {
      $item_timestamp = $pull ? $info
        ->getLastPull() : $info
        ->getLastPush();
      if ($item_timestamp) {
        if (!$timestamp || $timestamp < $item_timestamp) {
          $timestamp = $item_timestamp;
        }
      }
    }
    return $timestamp;
  }

  /**
   * Get the newest pull/push timestamp for this pool from all status
   * entities that exist for the given entity.
   *
   * @param $entity_type
   * @param $entity_uuid
   * @param int  $timestamp
   * @param bool $pull
   */
  public function setTimestamp($entity_type, $entity_uuid, $timestamp, $pull = true) {
    $entity_status = EntityStatus::getInfoForPool($entity_type, $entity_uuid, $this);
    foreach ($entity_status as $info) {
      if ($pull) {
        $info
          ->setLastPull($timestamp);
      }
      else {
        $info
          ->setLastPush($timestamp);
      }
      $info
        ->save();
    }
  }

  /**
   * Mark the entity as deleted in this pool (reflected on all entity status
   * entities related to this pool).
   *
   * @param $entity_type
   * @param $entity_uuid
   */
  public function markDeleted($entity_type, $entity_uuid) {
    $entity_status = EntityStatus::getInfoForPool($entity_type, $entity_uuid, $this);
    foreach ($entity_status as $info) {
      $info
        ->isDeleted(true);
      $info
        ->save();
    }
  }

  /**
   * Check whether this entity has been deleted intentionally already. In this
   * case we ignore push and pull intents for it.
   *
   * @param $entity_type
   * @param $entity_uuid
   *
   * @return bool
   */
  public function isEntityDeleted($entity_type, $entity_uuid) {
    $entity_status = EntityStatus::getInfoForPool($entity_type, $entity_uuid, $this);
    foreach ($entity_status as $info) {
      if ($info
        ->isDeleted()) {
        return true;
      }
    }
    return false;
  }

  /**
   * Load all cms_content_sync_pool entities.
   *
   * @return Pool[]
   */
  public static function getAll() {

    /**
     * @var Pool[] $configurations
     */
    return \Drupal::entityTypeManager()
      ->getStorage('cms_content_sync_pool')
      ->loadMultiple();
  }

  /**
   * Returns an list of pools that can be selected for an entity type.
   *
   * @oaram string $entity_type
   *  The entity type the pools should be returned for.
   *
   * @param string                              $bundle
   *                                                           The bundle the pools should be returned for
   * @param \Drupal\Core\Entity\EntityInterface $parent_entity
   *                                                           The
   *                                                           parent entity, if any. Only required if $field_name is given-.
   * @param string                              $field_name
   *                                                           The name of the parent entity field that
   *                                                           references this entity. In this case if the field handler is set to
   *                                                           "automatically push referenced entities", the user doesn't have to
   *                                                           make a choice as it is set automatically anyway.
   * @param mixed                               $entity_type
   *
   * @return array $selectable_pools
   */
  public static function getSelectablePools($entity_type, $bundle, $parent_entity = null, $field_name = null) {

    // Get all available flows.
    $flows = Flow::getAll();
    $configs = [];
    $selectable_pools = [];
    $selectable_flows = [];

    // When editing the entity directly, the "push as reference" flows won't be available and vice versa.
    $root_entity = !$parent_entity && !$field_name;
    if ($root_entity) {
      $allowed_push_options = [
        PushIntent::PUSH_FORCED,
        PushIntent::PUSH_MANUALLY,
        PushIntent::PUSH_AUTOMATICALLY,
      ];
    }
    else {
      $allowed_push_options = [
        PushIntent::PUSH_FORCED,
        PushIntent::PUSH_AS_DEPENDENCY,
      ];
    }
    foreach ($flows as $flow_id => $flow) {
      $flow_entity_config = $flow
        ->getEntityTypeConfig($entity_type, $bundle);
      if (empty($flow_entity_config)) {
        continue;
      }
      if ('ignore' == $flow_entity_config['handler']) {
        continue;
      }
      if (!in_array($flow_entity_config['export'], $allowed_push_options)) {
        continue;
      }
      if ($parent_entity && $field_name) {
        $parent_flow_config = $flow->sync_entities[$parent_entity
          ->getEntityTypeId() . '-' . $parent_entity
          ->bundle() . '-' . $field_name];
        if (!empty($parent_flow_config['handler_settings']['export_referenced_entities'])) {
          continue;
        }
      }
      $selectable_flows[$flow_id] = $flow;
      $configs[$flow_id] = [
        'flow_label' => $flow
          ->label(),
        'flow' => $flow
          ->getEntityTypeConfig($entity_type, $bundle),
      ];
    }
    foreach ($configs as $config_id => $config) {
      if (in_array('allow', $config['flow']['export_pools'])) {
        $selectable_pools[$config_id]['flow_label'] = $config['flow_label'];
        $selectable_pools[$config_id]['widget_type'] = $config['flow']['pool_export_widget_type'];
        foreach ($config['flow']['export_pools'] as $pool_id => $push_to_pool) {

          // Filter out all pools with configuration "allow".
          if (self::POOL_USAGE_ALLOW == $push_to_pool) {
            $pool_entity = \Drupal::entityTypeManager()
              ->getStorage('cms_content_sync_pool')
              ->loadByProperties([
              'id' => $pool_id,
            ]);
            $pool_entity = reset($pool_entity);
            $selectable_pools[$config_id]['pools'][$pool_id] = $pool_entity
              ->label();
          }
        }
      }
    }
    return $selectable_pools;
  }

  /**
   * Reset the status entities for this pool.
   *
   * @param string $pool_id
   *                        The pool the status entities should be reset for
   */
  public static function resetStatusEntities($pool_id = '') {

    // Reset the entity status.
    $status_storage = \Drupal::entityTypeManager()
      ->getStorage('cms_content_sync_entity_status');
    $connection = \Drupal::database();

    // For a single pool.
    if (!empty($pool_id)) {

      // Save flags to status entities that they have been reset.
      $connection
        ->query('UPDATE cms_content_sync_entity_status SET flags=flags|:flag WHERE last_export IS NOT NULL AND pool=:pool', [
        ':flag' => EntityStatus::FLAG_LAST_PUSH_RESET,
        ':pool' => $pool_id,
      ]);
      $connection
        ->query('UPDATE cms_content_sync_entity_status SET flags=flags|:flag WHERE last_import IS NOT NULL AND pool=:pool', [
        ':flag' => EntityStatus::FLAG_LAST_PULL_RESET,
        ':pool' => $pool_id,
      ]);

      // Actual reset.
      $db_query = $connection
        ->update($status_storage
        ->getBaseTable());
      $db_query
        ->fields([
        'last_export' => null,
        'last_import' => null,
      ]);
      $db_query
        ->condition('pool', $pool_id);
      $db_query
        ->execute();
    }
    else {

      // Save flags to status entities that they have been reset.
      $connection
        ->query('UPDATE cms_content_sync_entity_status SET flags=flags|:flag WHERE last_export IS NOT NULL', [
        ':flag' => EntityStatus::FLAG_LAST_PUSH_RESET,
      ]);
      $connection
        ->query('UPDATE cms_content_sync_entity_status SET flags=flags|:flag WHERE last_import IS NOT NULL', [
        ':flag' => EntityStatus::FLAG_LAST_PULL_RESET,
      ]);

      // Actual reset.
      $db_query = $connection
        ->update($status_storage
        ->getBaseTable());
      $db_query
        ->fields([
        'last_export' => null,
        'last_import' => null,
      ]);
      $db_query
        ->execute();
    }

    // Invalidate cache by storage.
    $status_storage
      ->resetCache();

    // Above cache clearing doesn't work reliably. So we reset the whole entity cache.
    \Drupal::service('cache.entity')
      ->deleteAll();
  }

  /**
   * Create a pool configuration programmatically.
   *
   * @param $pool_name
   * @param string $pool_id
   * @param $backend_url
   * @param $authentication_type
   */
  public static function createPool($pool_name, $pool_id, $backend_url, $authentication_type) {

    // If no pool_id is given, create one.
    if (empty($pool_id)) {
      $pool_id = strtolower($pool_name);
      $pool_id = preg_replace('@[^a-z0-9_]+@', '_', $pool_id);
    }
    $pools = Pool::getAll();
    if (array_key_exists($pool_id, $pools)) {
      \Drupal::messenger()
        ->addMessage('A pool with the machine name ' . $pool_id . ' does already exist. Therefor the creation has been skipped.', 'warning');
    }
    else {
      $uuid_service = \Drupal::service('uuid');
      $language_manager = \Drupal::service('language_manager');
      $default_language = $language_manager
        ->getDefaultLanguage();
      $pool_config = \Drupal::service('config.factory')
        ->getEditable('cms_content_sync.pool.' . $pool_id);
      $pool_config
        ->set('uuid', $uuid_service
        ->generate())
        ->set('langcode', $default_language
        ->getId())
        ->set('status', true)
        ->set('id', $pool_id)
        ->set('label', $pool_name)
        ->set('backend_url', $backend_url)
        ->set('authentication_type', $authentication_type)
        ->save();
    }
    return $pool_id;
  }

}

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::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
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.
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
Pool::$authentication_type Deprecated public property The authentication type to use. See Pool::AUTHENTICATION_TYPE_* for details.
Pool::$backend_url public property The Pool Sync Core backend URL.
Pool::$client protected property
Pool::$id public property The Pool ID.
Pool::$label public property The Pool label.
Pool::$site_id Deprecated public property The unique site identifier.
Pool::createPool public static function Create a pool configuration programmatically.
Pool::getAll public static function Load all cms_content_sync_pool entities.
Pool::getAllExternalUsages public static function Get a list of all sites for all pools that are using this entity. Only works for pools that are connected to the entity on this site.
Pool::getAllSitesWithDifferentEntityTypeVersion public static function Get a list of all sites from all pools that use a different version ID and provide a diff on field basis.
Pool::getClient public function
Pool::getNewestTimestamp public function Get the newest pull/push timestamp for this pool from all status entities that exist for the given entity.
Pool::getSelectablePools public static function Returns an list of pools that can be selected for an entity type.
Pool::getSyncCoreUrl public function Returns the Sync Core URL for this pool.
Pool::isEntityDeleted public function Check whether this entity has been deleted intentionally already. In this case we ignore push and pull intents for it.
Pool::markDeleted public function Mark the entity as deleted in this pool (reflected on all entity status entities related to this pool).
Pool::POOL_USAGE_ALLOW public constant
Pool::POOL_USAGE_FORBID public constant
Pool::POOL_USAGE_FORCE public constant
Pool::preDelete public static function Acts on entities before they are deleted and before hooks are invoked. Overrides ConfigEntityBase::preDelete
Pool::resetStatusEntities public static function Reset the status entities for this pool.
Pool::setTimestamp public function Get the newest pull/push timestamp for this pool from all status entities that exist for the given entity.
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