You are here

class Flow in CMS Content Sync 2.1.x

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

Defines the "Content Sync - Flow" entity.

Plugin annotation


@ConfigEntityType(
  id = "cms_content_sync_flow",
  label = @Translation("Content Sync - Flow"),
  handlers = {
    "list_builder" = "Drupal\cms_content_sync\Controller\FlowListBuilder",
    "form" = {
      "add" = "Drupal\cms_content_sync\Form\FlowForm",
      "edit" = "Drupal\cms_content_sync\Form\FlowForm",
      "delete" = "Drupal\cms_content_sync\Form\FlowDeleteForm",
      "copy_remote" = "Drupal\cms_content_sync\Form\CopyRemoteFlow",
    }
  },
  config_prefix = "flow",
  admin_permission = "administer cms content sync",
  entity_keys = {
    "id" = "id",
    "label" = "name",
  },
  config_export = {
    "id",
    "name",
    "variant",
    "type",
    "simple_settings",
    "per_bundle_settings",
    "sync_entities",
  },
  links = {
    "edit-form" = "/admin/config/services/cms_content_sync/flow/{cms_content_sync_flow}/edit",
    "delete-form" = "/admin/config/services/cms_content_sync/flow/{cms_content_sync_flow}/delete",
  }
)

Hierarchy

Expanded class hierarchy of Flow

43 files declare their use of Flow
CliService.php in src/Cli/CliService.php
CliService.php in modules/cms_content_sync_developer/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.
ConfigSubscriber.php in src/EventSubscriber/ConfigSubscriber.php

... See full list

4 string references to 'Flow'
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/Flow.php, line 52

Namespace

Drupal\cms_content_sync\Entity
View source
class Flow extends ConfigEntityBase implements FlowInterface {

  /**
   * @var string HANDLER_IGNORE
   *             Ignore this entity type / bundle / field completely
   */
  public const HANDLER_IGNORE = 'ignore';

  /**
   * @var string PREVIEW_DISABLED
   *             Hide these entities completely
   */
  public const PREVIEW_DISABLED = 'disabled';

  /**
   * @var string PREVIEW_TABLE
   *             Show these entities in a table view
   */
  public const PREVIEW_TABLE = 'table';

  /**
   * This Flow pushes entities.
   */
  public const TYPE_PUSH = 'push';

  /**
   * This Flow pulls entities.
   */
  public const TYPE_PULL = 'pull';

  /**
   * This Flow pushes and pulls entities.
   *
   * @deprecated will be removed in v2
   */
  public const TYPE_BOTH = 'both';
  public const V2_STATUS_NONE = '';
  public const V2_STATUS_EXPORTED = 'exported';
  public const V2_STATUS_ACTIVE = 'active';
  public const VARIANT_SIMPLE = 'simple';
  public const VARIANT_PER_BUNDLE = 'per-bundle';

  /**
   * The variant. Simple is the new default, per-bundle is the old default for
   * Flows created before v2.1.
   * Simple offers only a handful of options and applies the same settings
   * to all entity types whereas per-bundle mode allows for entity type based
   * management of all configuration; so more complex but also more precise.
   * Simple uses our new embed frontend, so has better UX whereas per-bundle
   * uses clunky Drupal forms.
   *
   * @var string
   */
  public $variant;

  /**
   * Either "push" or "pull".
   *
   * @var string
   */
  public $type;

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

  /**
   * The Flow name.
   *
   * @var string
   */
  public $name;

  /**
   * The settings for variant Simple.
   *
   * @var array
   */
  public $simple_settings;

  /**
   * The settings for variant per-bundle. Hierarchy is:
   * [type machine name e.g. 'node']
   *   [bundle machine name e.g. 'page']
   *     ['settings']
   *       [...]
   *     ['properties']
   *       [property/field name e.g. 'title']
   *         [...]
   *
   * @var array
   */
  public $per_bundle_settings;

  /**
   * Old way to store settings. This is automatically migrated to be stored in
   * the new `$per_bundle_settings` property instead by
   * `cms_content_sync_update_8021`.
   *
   * @var array
   *
   * @deprecated
   */
  public $sync_entities;

  /**
   * @var Flow[]
   *             All content synchronization configs. Use {@see Flow::getAll}
   *             to request them.
   */
  public static $all = null;

  /**
   * Ensure that pools are pulled before the flows.
   */
  public function calculateDependencies() {
    parent::calculateDependencies();
    foreach ($this
      ->getController()
      ->getUsedPools() as $pool) {
      $this
        ->addDependency('config', 'cms_content_sync.pool.' . $pool->id);
    }
  }

  /**
   * @var IFlowController
   */
  protected $handler;

  /**
   * Provide the controller to act upon the stored configuration.
   *
   * @return IFlowController
   */
  public function getController() {
    if (!$this->handler) {
      if ($this->variant === Flow::VARIANT_PER_BUNDLE) {
        $this->handler = new FlowControllerPerBundle($this);
      }
      else {
        $this->handler = new FlowControllerSimple($this);
      }
    }
    return $this->handler;
  }

  /**
   * Get all flows pushing this entity.
   *
   * @param \Drupal\Core\Entity\EntityInterface $entity
   * @param $action
   * @param bool $include_dependencies
   *
   * @throws \Exception
   *
   * @return array|Flow[]
   */
  public static function getFlowsForPushing($entity, $action, $include_dependencies = true) {
    if (SyncIntent::ACTION_DELETE === $action) {
      $last_push = EntityStatus::getLastPushForEntity($entity);
      if (empty($last_push)) {
        return [];
      }
    }
    $flows = PushIntent::getFlowsForEntity($entity, PushIntent::PUSH_AUTOMATICALLY, $action);
    if (!count($flows) && SyncIntent::ACTION_DELETE === $action) {
      $flows = PushIntent::getFlowsForEntity($entity, PushIntent::PUSH_MANUALLY, $action);
    }
    if ($include_dependencies && !count($flows)) {
      $flows = PushIntent::getFlowsForEntity($entity, PushIntent::PUSH_AS_DEPENDENCY, $action);
      if (count($flows)) {
        $infos = EntityStatus::getInfosForEntity($entity
          ->getEntityTypeId(), $entity
          ->uuid());
        $pushed = [];
        foreach ($infos as $info) {
          if (!in_array($info
            ->getFlow(), $flows)) {
            continue;
          }
          if (in_array($info
            ->getFlow(), $pushed)) {
            continue;
          }
          if (!$info
            ->getLastPush()) {
            continue;
          }
          $pushed[] = $info
            ->getFlow();
        }
        $flows = $pushed;
      }
    }
    return $flows;
  }

  /**
   * Get a unique version hash for the configuration of the provided entity type
   * and bundle.
   *
   * @param string $type_name
   *                            The entity type in question
   * @param string $bundle_name
   *                            The bundle in question
   *
   * @return string
   *                A 32 character MD5 hash of all important configuration for this entity
   *                type and bundle, representing it's current state and allowing potential
   *                conflicts from entity type updates to be handled smoothly
   */
  public static function getEntityTypeVersion($type_name, $bundle_name) {

    // @todo Include export_config keys in version definition for config entity types like webforms.
    if (EntityHandlerPluginManager::isEntityTypeFieldable($type_name)) {
      $entityFieldManager = \Drupal::service('entity_field.manager');
      $field_definitions = $entityFieldManager
        ->getFieldDefinitions($type_name, $bundle_name);
      $field_definitions_array = (array) $field_definitions;
      unset($field_definitions_array['field_cms_content_synced']);
      $field_names = array_keys($field_definitions_array);
      sort($field_names);
      $version = json_encode($field_names);
    }
    else {
      $version = '';
    }
    return md5($version);
  }

  /**
   * Check whether the local deletion of the given entity is allowed.
   *
   * @return bool
   */
  public static function isLocalDeletionAllowed(EntityInterface $entity) {
    if (!$entity
      ->uuid()) {
      return true;
    }
    $entity_status = EntityStatus::getInfosForEntity($entity
      ->getEntityTypeId(), $entity
      ->uuid());
    foreach ($entity_status as $info) {
      if (!$info
        ->getLastPull() || $info
        ->isSourceEntity()) {
        continue;
      }
      $flow = $info
        ->getFlow();
      if (!$flow) {
        continue;
      }
      $config = $flow
        ->getController()
        ->getEntityTypeConfig($entity
        ->getEntityTypeId(), $entity
        ->bundle(), true);
      if (PullIntent::PULL_DISABLED === $config['import']) {
        continue;
      }
      if (!boolval($config['import_deletion_settings']['allow_local_deletion_of_import'])) {
        return false;
      }
    }
    return true;
  }

  /**
   * Load all entities.
   *
   * Load all cms_content_sync_flow entities and add overrides from global $config.
   *
   * @param bool $skip_inactive
   *                            Do not return inactive flows by default
   *
   * @throws \Drupal\Component\Plugin\Exception\InvalidPluginDefinitionException
   * @throws \Drupal\Component\Plugin\Exception\PluginNotFoundException
   *
   * @return Flow[]
   */
  public static function getAll($skip_inactive = true, $rebuild = false) {
    if ($skip_inactive && null !== self::$all && !$rebuild) {
      return self::$all;
    }

    /**
     * @var Flow[] $configurations
     */
    $configurations = \Drupal::entityTypeManager()
      ->getStorage('cms_content_sync_flow')
      ->loadMultiple();
    foreach ($configurations as $id => &$configuration) {
      global $config;
      $config_name = 'cms_content_sync.flow.' . $id;
      if (!isset($config[$config_name]) || empty($config[$config_name])) {
        continue;
      }
      foreach ($config[$config_name] as $key => $new_value) {
        if (in_array($key, [
          'per_bundle_settings',
          'simple_settings',
        ])) {
          $configuration->{$key} = array_merge_recursive($configuration->{$key}, $new_value);
          continue;
        }
        $configuration
          ->set($key, $new_value);
      }

      // Calculate 'version' property if missing.
      $configuration
        ->getController()
        ->getEntityTypeConfig();
    }
    if ($skip_inactive) {
      $result = [];
      foreach ($configurations as $id => $flow) {
        if ($flow
          ->get('status')) {
          $result[$id] = $flow;
        }
      }
      $configurations = $result;
      self::$all = $configurations;
    }
    return $configurations;
  }
  public static function resetFlowCache() {
    self::$all = null;
  }

  /**
   * Get the first synchronization that allows the pull of the provided entity
   * type.
   *
   * @param Pool   $pool
   * @param string $entity_type_name
   * @param string $bundle_name
   * @param string $reason
   * @param string $action
   * @param bool   $strict
   *
   * @return null|Flow
   */
  public static function getFlowForPoolAndEntityType($pool, $entity_type_name, $bundle_name, $reason, $action = SyncIntent::ACTION_CREATE, $strict = false) {
    $flows = self::getAll();

    // If $reason is DEPENDENCY and there's a Flow pulling AUTOMATICALLY we take that. But only if there's no Flow
    // explicitly handling this entity AS_DEPENDENCY.
    $fallback = null;
    foreach ($flows as $flow) {
      if ($pool && !in_array($pool, $flow
        ->getController()
        ->getUsedPoolsForPulling($entity_type_name, $bundle_name))) {
        continue;
      }
      if (!$flow
        ->getController()
        ->canPullEntity($entity_type_name, $bundle_name, $reason, $action, true)) {
        if (!$strict && $flow
          ->getController()
          ->canPullEntity($entity_type_name, $bundle_name, $reason, $action, false)) {
          $fallback = $flow;
        }
        continue;
      }
      return $flow;
    }
    if (!empty($fallback)) {
      return $fallback;
    }
    return null;
  }

  /**
   * Unset the flow version warning.
   */
  public function resetVersionWarning() {
    $moduleHandler = \Drupal::service('module_handler');
    if ($moduleHandler
      ->moduleExists('cms_content_sync_developer')) {
      $developer_config = \Drupal::service('config.factory')
        ->getEditable('cms_content_sync.developer');
      $mismatching_versions = $developer_config
        ->get('version_mismatch');
      if (!empty($mismatching_versions)) {
        unset($mismatching_versions[$this
          ->id()]);
        $developer_config
          ->set('version_mismatch', $mismatching_versions)
          ->save();
      }
    }
  }

  /**
   * @param $type
   * @param $bundle
   * @param IFlowController|null $existing
   * @param null $field
   *
   * @return array
   */
  public static function getDefaultFieldConfigForEntityType($type, $bundle, $existing = null, $field = null) {
    if ($field) {
      $field_default_values = [
        'export' => null,
        'import' => null,
      ];
      $entity_type = \Drupal::entityTypeManager()
        ->getDefinition($type);

      // @todo Should be gotten from the Entity Type Handler instead.
      $forbidden_fields = [
        // These are not relevant or misleading when synchronized.
        'revision_default',
        'revision_translation_affected',
        'content_translation_outdated',
        // Field collections.
        'host_type',
        // Files.
        'uri',
        'filemime',
        'filesize',
        // Media.
        'thumbnail',
        // Taxonomy.
        'parent',
        // These are standard fields defined by the Flow
        // Entity type that entities may not override (otherwise
        // these fields will collide with CMS Content Sync functionality)
        $entity_type
          ->getKey('bundle'),
        $entity_type
          ->getKey('id'),
        $entity_type
          ->getKey('uuid'),
        $entity_type
          ->getKey('label'),
        $entity_type
          ->getKey('revision'),
      ];
      $pools = Pool::getAll();
      if (count($pools)) {
        $reserved = reset($pools)
          ->getClient()
          ->getReservedPropertyNames();
        $forbidden_fields = array_merge($forbidden_fields, $reserved);
      }
      if (false !== in_array($field, $forbidden_fields)) {
        $field_default_values['handler'] = 'ignore';
        $field_default_values['export'] = PushIntent::PUSH_DISABLED;
        $field_default_values['import'] = PullIntent::PULL_DISABLED;
        return $field_default_values;
      }
      $field_handler_service = \Drupal::service('plugin.manager.cms_content_sync_field_handler');
      $field_definition = \Drupal::service('entity_field.manager')
        ->getFieldDefinitions($type, $bundle)[$field];
      $field_handlers = $field_handler_service
        ->getHandlerOptions($type, $bundle, $field, $field_definition, true);
      if (empty($field_handlers)) {
        throw new \Exception('Unsupported field type ' . $field_definition
          ->getType() . ' for field ' . $type . '.' . $bundle . '.' . $field);
      }
      reset($field_handlers);
      $handler_id = empty($field_default_values['handler']) ? key($field_handlers) : $field_default_values['handler'];
      $field_default_values['handler'] = $handler_id;
      $field_default_values['export'] = PushIntent::PUSH_AUTOMATICALLY;
      $field_default_values['import'] = PullIntent::PULL_AUTOMATICALLY;
      $handler = $field_handler_service
        ->createInstance($handler_id, [
        'entity_type_name' => $type,
        'bundle_name' => $bundle,
        'field_name' => $field,
        'field_definition' => $field_definition,
        'settings' => $field_default_values,
        'sync' => null,
      ]);
      $advanced_settings = $handler
        ->getHandlerSettings($field_default_values);
      if (count($advanced_settings)) {
        foreach ($advanced_settings as $name => $element) {
          $field_default_values['handler_settings'][$name] = $element['#default_value'];
        }
      }
      return $field_default_values;
    }
    $entityTypeManager = \Drupal::service('entity_type.manager');
    $type = $entityTypeManager
      ->getDefinition($type, false);
    $field_definition = $type ? \Drupal::service('entity_field.manager')
      ->getFieldDefinitions($type, $bundle) : false;
    $result = [];
    if ($field_definition) {
      foreach ($field_definition as $key => $field) {
        $field_config = $existing ? $existing
          ->getPropertyConfig($type, $bundle, $key) : NULL;
        $result[$key] = $field_config ? $field_config : self::getDefaultFieldConfigForEntityType($type, $bundle, null, $key);
      }
    }
    return $result;
  }
  public function useV2() {
    return self::V2_STATUS_ACTIVE === $this
      ->getV2Status() || Migration::useV2();
  }
  public function v2Ready() {
    $status = $this
      ->getV2Status();
    return self::V2_STATUS_NONE != $status;
  }
  public function getV2Status() {
    return Migration::getFlowStatus($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
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::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::onDependencyRemoval public function Informs the entity that entities it depends on will be deleted. Overrides ConfigEntityInterface::onDependencyRemoval 8
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::__construct public function Constructs an Entity object. Overrides EntityBase::__construct 10
ConfigEntityBase::__sleep public function Overrides EntityBase::__sleep 4
DependencySerializationTrait::$_entityStorages protected property
DependencySerializationTrait::$_serviceIds protected property
DependencySerializationTrait::__sleep public function Aliased as: traitSleep 2
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::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 18
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 7
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.
Flow::$all public static property All content synchronization configs. Use { to request them.
Flow::$handler protected property
Flow::$id public property The Flow ID.
Flow::$name public property The Flow name.
Flow::$per_bundle_settings public property The settings for variant per-bundle. Hierarchy is: [type machine name e.g. 'node'] [bundle machine name e.g. 'page'] ['settings'] [...] ['properties'] [property/field name e.g. 'title'] [...]
Flow::$simple_settings public property The settings for variant Simple.
Flow::$sync_entities public property Old way to store settings. This is automatically migrated to be stored in the new `$per_bundle_settings` property instead by `cms_content_sync_update_8021`.
Flow::$type public property Either "push" or "pull".
Flow::$variant public property The variant. Simple is the new default, per-bundle is the old default for Flows created before v2.1. Simple offers only a handful of options and applies the same settings to all entity types whereas per-bundle mode allows for entity type…
Flow::calculateDependencies public function Ensure that pools are pulled before the flows. Overrides ConfigEntityBase::calculateDependencies
Flow::getAll public static function Load all entities.
Flow::getController public function Provide the controller to act upon the stored configuration.
Flow::getDefaultFieldConfigForEntityType public static function
Flow::getEntityTypeVersion public static function Get a unique version hash for the configuration of the provided entity type and bundle.
Flow::getFlowForPoolAndEntityType public static function Get the first synchronization that allows the pull of the provided entity type.
Flow::getFlowsForPushing public static function Get all flows pushing this entity.
Flow::getV2Status public function
Flow::HANDLER_IGNORE public constant Ignore this entity type / bundle / field completely
Flow::isLocalDeletionAllowed public static function Check whether the local deletion of the given entity is allowed.
Flow::PREVIEW_DISABLED public constant Hide these entities completely
Flow::PREVIEW_TABLE public constant Show these entities in a table view
Flow::resetFlowCache public static function
Flow::resetVersionWarning public function Unset the flow version warning.
Flow::TYPE_BOTH Deprecated public constant This Flow pushes and pulls entities.
Flow::TYPE_PULL public constant This Flow pulls entities.
Flow::TYPE_PUSH public constant This Flow pushes entities.
Flow::useV2 public function
Flow::v2Ready public function
Flow::V2_STATUS_ACTIVE public constant
Flow::V2_STATUS_EXPORTED public constant
Flow::V2_STATUS_NONE public constant
Flow::VARIANT_PER_BUNDLE public constant
Flow::VARIANT_SIMPLE public constant
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