You are here

class BeforeEntityTypeExport in CMS Content Sync 2.0.x

Same name and namespace in other branches
  1. 8 src/Event/BeforeEntityTypeExport.php \Drupal\cms_content_sync\Event\BeforeEntityTypeExport
  2. 2.1.x src/Event/BeforeEntityTypeExport.php \Drupal\cms_content_sync\Event\BeforeEntityTypeExport

An entity type is about to be exported. Other modules can use this to add additional fields to the entity type definition, allowing them to process additional information during push and pull (by using BeforeEntityPush and BeforeEntityPull). Check out the cms_content_sync_simple_sitemap submodule to see how it can be used.

Hierarchy

Expanded class hierarchy of BeforeEntityTypeExport

3 files declare their use of BeforeEntityTypeExport
DraggableViewsSyncExtend.php in modules/cms_content_sync_draggableviews/src/EventSubscriber/DraggableViewsSyncExtend.php
SimpleSitemapSyncExtend.php in modules/cms_content_sync_simple_sitemap/src/EventSubscriber/SimpleSitemapSyncExtend.php
SyncCoreFlowExport.php in src/SyncCoreFlowExport.php

File

src/Event/BeforeEntityTypeExport.php, line 15

Namespace

Drupal\cms_content_sync\Event
View source
class BeforeEntityTypeExport extends Event {
  public const EVENT_NAME = 'cms_content_sync.entity_type.push.before';

  /**
   * Entity type.
   *
   * @var string
   */
  protected $entity_type_name;

  /**
   * Bundle.
   *
   * @var string
   */
  protected $bundle_name;

  /**
   * Entity type definition.
   *
   * @var \EdgeBox\SyncCore\Interfaces\Configuration\IDefineEntityType
   */
  protected $definition;

  /**
   * Constructs a entity export event.
   *
   * @param string                                                       $entity_type_name
   * @param string                                                       $bundle_name
   * @param \EdgeBox\SyncCore\Interfaces\Configuration\IDefineEntityType $definition
   */
  public function __construct($entity_type_name, $bundle_name, &$definition) {
    $this->entity_type_name = $entity_type_name;
    $this->bundle_name = $bundle_name;
    $this->definition =& $definition;
  }

  /**
   * @return string
   */
  public function getBundleName() {
    return $this->bundle_name;
  }

  /**
   * @return string
   */
  public function getEntityTypeName() {
    return $this->entity_type_name;
  }

  /**
   * @return \EdgeBox\SyncCore\Interfaces\Configuration\IDefineEntityType
   */
  public function getDefinition() {
    return $this->definition;
  }

}

Members

Namesort descending Modifiers Type Description Overrides
BeforeEntityTypeExport::$bundle_name protected property Bundle.
BeforeEntityTypeExport::$definition protected property Entity type definition.
BeforeEntityTypeExport::$entity_type_name protected property Entity type.
BeforeEntityTypeExport::EVENT_NAME public constant
BeforeEntityTypeExport::getBundleName public function
BeforeEntityTypeExport::getDefinition public function
BeforeEntityTypeExport::getEntityTypeName public function
BeforeEntityTypeExport::__construct public function Constructs a entity export event.