You are here

class RngEventType in RNG - Events and Registrations 8.2

Same name and namespace in other branches
  1. 3.x src/Entity/RngEventType.php \Drupal\rng\Entity\RngEventType

Defines the event type entity.

Plugin annotation


@ConfigEntityType(
  id = "rng_event_type",
  label = @Translation("Event type"),
  handlers = {
    "list_builder" = "\Drupal\rng\Lists\EventTypeListBuilder",
    "form" = {
      "add" = "Drupal\rng\Form\EventTypeForm",
      "edit" = "Drupal\rng\Form\EventTypeForm",
      "delete" = "Drupal\rng\Form\EventTypeDeleteForm",
      "event_access_defaults" = "Drupal\rng\Form\EventTypeAccessDefaultsForm",
      "event_default_messages" = "Drupal\rng\Form\EventTypeDefaultMessagesListForm",
      "field_mapping" = "Drupal\rng\Form\EventTypeFieldMappingForm",
    }
  },
  admin_permission = "administer event types",
  config_prefix = "rng_event_type",
  entity_keys = {
    "id" = "id",
    "label" = "id"
  },
  links = {
    "edit-form" = "/admin/structure/rng/event_types/manage/{rng_event_type}/edit",
    "delete-form" = "/admin/structure/rng/event_types/manage/{rng_event_type}/delete",
    "event-access-defaults" = "/admin/structure/rng/event_types/manage/{rng_event_type}/access_defaults",
    "field-mapping" = "/admin/structure/rng/event_types/manage/{rng_event_type}/field_mapping",
  }
)

Hierarchy

Expanded class hierarchy of RngEventType

3 files declare their use of RngEventType
RngEventTypeEntityTest.php in tests/src/Kernel/RngEventTypeEntityTest.php
RngEventTypeTest.php in src/Tests/RngEventTypeTest.php
RngTestTrait.php in src/Tests/RngTestTrait.php

File

src/Entity/RngEventType.php, line 43

Namespace

Drupal\rng\Entity
View source
class RngEventType extends ConfigEntityBase implements EventTypeInterface {

  /**
   * The machine name of this event config.
   *
   * Inspired by two part-ID's from \Drupal\field\Entity\FieldStorageConfig.
   *
   * Config will compute to rng.event.{entity_type}.{bundle}
   *
   * entity_type and bundle are duplicated in file name and config.
   *
   * @var string
   */
  protected $id;

  /**
   * The ID of the event entity type.
   *
   * Matches entities with this entity type.
   *
   * @var string
   */
  protected $entity_type;

  /**
   * The ID of the event bundle type.
   *
   * Matches entities with this bundle.
   *
   * @var string
   */
  protected $bundle;

  /**
   * Mirror update permissions.
   *
   * The operation to mirror from the parent entity. For example, if the user
   * has permission to do 'update' operation on the event entity and you want
   * to mirror it. You should set this to 'update'.
   *
   * @var string
   */
  public $mirror_operation_to_event_manage;

  /**
   * Allow event managers to customize default rules.
   *
   * @var bool
   */
  public $custom_rules = TRUE;

  /**
   * Registrant type for new registrants associated with this event type.
   *
   * @var string
   */
  protected $default_registrant;

  /**
   * Whether or not registrants should be allowed to be added registrations
   * without any other identity entity.
   *
   * @var bool
   */
  protected $allow_anon_registrants;

  /**
   * Whether or not matching field data should be sync'd with identities when
   * a registrant is saved.
   *
   * @var bool
   */
  protected $auto_sync_registrants;

  /**
   * Whether or not to automatically attach registrants to user identities by
   * email.
   *
   * @var bool
   */
  protected $auto_attach_users;

  /**
   * An email field on the registrant to use to sync to users.
   *
   * @var string
   */
  protected $registrant_email_field;
  protected $event_start_date_field;
  protected $event_end_date_field;

  /**
   * Types of people types allowed to be associated with this event type.
   *
   * @var array
   */
  protected $people_types = [];

  /**
   * Default messages configured for this event type.
   *
   * @var array
   */
  protected $default_messages = [];

  /**
   * Fields to add to event bundles.
   *
   * @var array
   */
  public $fields = [
    EventManagerInterface::FIELD_REGISTRATION_TYPE,
    EventManagerInterface::FIELD_REGISTRATION_GROUPS,
    EventManagerInterface::FIELD_STATUS,
    EventManagerInterface::FIELD_WAIT_LIST,
    EventManagerInterface::FIELD_REGISTRANTS_CAPACITY,
    EventManagerInterface::FIELD_CAPACITY_CONFIRMED_ONLY,
    EventManagerInterface::FIELD_EMAIL_REPLY_TO,
    EventManagerInterface::FIELD_ALLOW_DUPLICATE_REGISTRANTS,
  ];

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

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

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

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

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

  /**
   * {@inheritdoc}
   */
  public function setEventManageOperation($permission) {
    $this->mirror_operation_to_event_manage = $permission;
    return $this;
  }

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

  /**
   * {@inheritdoc}
   */
  public function setAllowCustomRules($allow) {
    $this->custom_rules = $allow;
    return $this;
  }

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

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

  /**
   * {@inheritdoc}
   */
  public function setDefaultMessages($messages) {
    $this->default_messages = $messages;
    return $this;
  }

  /**
   * {@inheritdoc}
   */
  public function canIdentityTypeCreate($entity_type, $bundle) {
    $key = $this
      ->getIdentityTypeKey($entity_type, $bundle);
    return !empty($this->people_types[$key]['create']);
  }

  /**
   * {@inheritdoc}
   */
  public function setIdentityTypeCreate($entity_type, $bundle, $enabled) {
    $key = $this
      ->getIdentityTypeKey($entity_type, $bundle);
    $this->people_types[$key]['create'] = $enabled;
    return $this;
  }

  /**
   * {@inheritdoc}
   */
  public function getIdentityTypeEntityFormMode($entity_type, $bundle) {
    $key = $this
      ->getIdentityTypeKey($entity_type, $bundle);
    return !empty($this->people_types[$key]['entity_form_mode']) ? $this->people_types[$key]['entity_form_mode'] : 'default';
  }

  /**
   * {@inheritdoc}
   */
  public function getIdentityTypeEntityFormModes() {
    $result = [];
    foreach ($this->people_types as $people_type) {
      $required_keys = [
        'entity_type',
        'bundle',
        'entity_form_mode',
      ];

      // Ensure keys exist.
      if (count($required_keys) === count(array_intersect_key(array_flip($required_keys), $people_type))) {
        $entity_type = $people_type['entity_type'];
        $bundle = $people_type['bundle'];
        $result[$entity_type][$bundle] = $people_type['entity_form_mode'];
      }
    }
    return $result;
  }

  /**
   * {@inheritdoc}
   */
  public function setIdentityTypeEntityFormMode($entity_type, $bundle, $form_mode) {
    $key = $this
      ->getIdentityTypeKey($entity_type, $bundle);
    $this->people_types[$key]['entity_form_mode'] = $form_mode;
    return $this;
  }

  /**
   * {@inheritdoc}
   */
  public function canIdentityTypeReference($entity_type, $bundle) {
    $key = $this
      ->getIdentityTypeKey($entity_type, $bundle);
    return !empty($this->people_types[$key]['existing']);
  }

  /**
   * {@inheritdoc}
   */
  public function setIdentityTypeReference($entity_type, $bundle, $enabled) {
    $key = $this
      ->getIdentityTypeKey($entity_type, $bundle);
    $this->people_types[$key]['existing'] = $enabled;
    return $this;
  }

  /**
   * Get the array key of the people type.
   *
   * @param string $entity_type
   *   The identity entity type ID.
   * @param string $bundle
   *   The identity bundle.
   * @param bool $create_key
   *   Will initialise the array key.
   *
   * @return int|false
   *   The array key, or FALSE if it does not exist.
   */
  protected function getIdentityTypeKey($entity_type, $bundle, $create_key = TRUE) {
    if (isset($this->people_types)) {
      $pairs = $this->people_types;
      foreach ($pairs as $k => $pair) {
        if ($pair['entity_type'] == $entity_type && $pair['bundle'] == $bundle) {
          return $k;
        }
      }
    }
    if ($create_key) {

      // Create if it doesn't exist.
      $next_key = count($this->people_types) + 1;
      $this->people_types[$next_key] = [
        'entity_type' => $entity_type,
        'bundle' => $bundle,
      ];
      return $next_key;
    }
    return FALSE;
  }

  /**
   * {@inheritdoc}
   */
  public function setDefaultRegistrantType($registrant_type_id) {
    $this->default_registrant = $registrant_type_id;
    return $this;
  }

  /**
   * {@inheritdoc}
   */
  public function id() {
    return $this
      ->getEventEntityTypeId() . '.' . $this
      ->getEventBundle();
  }

  /**
   * {@inheritdoc}
   */
  public static function courierContextCC($entity_type, $operation) {
    $event_types = \Drupal::service('rng.event_manager')
      ->eventTypeWithEntityType($entity_type);
    if (!count($event_types)) {
      $courier_context = CourierContext::load('rng_registration_' . $entity_type);
      if ($courier_context) {
        if ($operation == 'delete') {
          $courier_context
            ->delete();
        }
      }
      else {
        if ($operation == 'create') {
          $entity_type_info = \Drupal::entityTypeManager()
            ->getDefinition($entity_type);
          $courier_context = CourierContext::create([
            'label' => t('Event (@entity_type): Registration', [
              '@entity_type' => $entity_type_info
                ->getLabel(),
            ]),
            'id' => 'rng_registration_' . $entity_type,
            'tokens' => [
              $entity_type,
              'registration',
            ],
          ]);
          $courier_context
            ->save();
        }
      }
    }
  }

  /**
   * {@inheritdoc}
   */
  public function preSave(EntityStorageInterface $storage) {
    parent::preSave($storage);
    if ($this
      ->isNew()) {
      $this
        ->courierContextCC($this->entity_type, 'create');
    }
  }

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

    // Create mode for the entity type.
    $mode_id = $this->entity_type . '.rng_event';
    if (!EntityFormMode::load($mode_id)) {
      EntityFormMode::create([
        'id' => $mode_id,
        'targetEntityType' => $this->entity_type,
        'label' => 'Event Settings',
        'status' => TRUE,
      ])
        ->save();
    }
    if (!$update) {
      module_load_include('inc', 'rng', 'rng.field.defaults');
      foreach ($this->fields as $field) {
        rng_add_event_field_storage($field, $this->entity_type);
        rng_add_event_field_config($field, $this
          ->getEventEntityTypeId(), $this
          ->getEventBundle());
      }
    }
    $display = entity_get_form_display($this->entity_type, $this->bundle, 'rng_event');
    if ($display
      ->isNew()) {

      // EntityDisplayBase::init() adds default fields. Remove them.
      foreach (array_keys($display
        ->getComponents()) as $name) {
        if (!in_array($name, $this->fields)) {
          $display
            ->removeComponent($name);
        }
      }

      // Weight is the key.
      $field_weights = [
        EventManagerInterface::FIELD_STATUS,
        EventManagerInterface::FIELD_ALLOW_DUPLICATE_REGISTRANTS,
        EventManagerInterface::FIELD_WAIT_LIST,
        EventManagerInterface::FIELD_REGISTRANTS_CAPACITY,
        EventManagerInterface::FIELD_EMAIL_REPLY_TO,
        EventManagerInterface::FIELD_REGISTRATION_TYPE,
        EventManagerInterface::FIELD_REGISTRATION_GROUPS,
      ];
      module_load_include('inc', 'rng', 'rng.field.defaults');
      foreach ($this->fields as $name) {
        rng_add_event_form_display_defaults($display, $name);
        if (in_array($name, $field_weights)) {
          $component = $display
            ->getComponent($name);
          $component['weight'] = array_search($name, $field_weights);
          $display
            ->setComponent($name, $component);
        }
      }
      $display
        ->save();
    }

    // Rebuild routes and local tasks.
    \Drupal::service('router.builder')
      ->setRebuildNeeded();

    // Rebuild local actions https://github.com/dpi/rng/issues/18
    \Drupal::service('plugin.manager.menu.local_action')
      ->clearCachedDefinitions();
  }

  /**
   * {@inheritdoc}
   */
  public function delete() {
    foreach ($this->fields as $field) {
      $field = FieldConfig::loadByName($this
        ->getEventEntityTypeId(), $this
        ->getEventBundle(), $field);
      if ($field) {
        $field
          ->delete();
      }
      $display = entity_get_form_display($this->entity_type, $this->bundle, 'rng_event');
      if (!$display
        ->isNew()) {
        $display
          ->delete();
      }
    }
    parent::delete();
  }

  /**
   * {@inheritdoc}
   */
  public static function postDelete(EntityStorageInterface $storage, array $entities) {
    parent::postDelete($storage, $entities);
    if ($event_type = reset($entities)) {
      RngEventType::courierContextCC($event_type->entity_type, 'delete');
    }

    // Rebuild routes and local tasks.
    \Drupal::service('router.builder')
      ->setRebuildNeeded();

    // Rebuild local actions https://github.com/dpi/rng/issues/18
    \Drupal::service('plugin.manager.menu.local_action')
      ->clearCachedDefinitions();
  }

  /**
   * {@inheritdoc}
   */
  public function calculateDependencies() {
    parent::calculateDependencies();

    // Event entity type/bundle.
    $entity_type = \Drupal::entityTypeManager()
      ->getDefinition($this
      ->getEventEntityTypeId());
    if ($entity_type) {
      $bundle_entity_type = $entity_type
        ->getBundleEntityType();
      if ($bundle_entity_type && $bundle_entity_type !== 'bundle') {
        $bundle = \Drupal::entityTypeManager()
          ->getStorage($entity_type
          ->getBundleEntityType())
          ->load($this
          ->getEventBundle());
        if ($bundle) {
          $this
            ->addDependency('config', $bundle
            ->getConfigDependencyName());
        }
      }
      else {
        $this
          ->addDependency('module', $entity_type
          ->getProvider());
      }
    }

    // Default registrant type.
    $registrant_type_id = $this
      ->getDefaultRegistrantType();
    if ($registrant_type_id) {
      $registrant_type = RegistrantType::load($registrant_type_id);
      if ($registrant_type) {
        $this
          ->addDependency('config', $registrant_type
          ->getConfigDependencyName());
      }
    }
    return $this;
  }

  /**
   * {@inheritdoc}
   */
  public function onDependencyRemoval(array $dependencies) {
    $changed = parent::onDependencyRemoval($dependencies);
    foreach ($dependencies['config'] as $entity) {
      if ($entity instanceof RegistrantTypeInterface) {

        // Registrant type is being deleted.
        if ($entity
          ->id() === $this
          ->getDefaultRegistrantType()) {
          $this
            ->setDefaultRegistrantType(NULL);
          $changed = TRUE;
        }
      }
    }
    return $changed;
  }

  /**
   * @inheritDoc
   */
  public function getAllowAnonRegistrants() {
    return $this->allow_anon_registrants;
  }

  /**
   * @inheritDoc
   */
  public function setAllowAnonRegistrants($allow_anon_registrants) {
    $this->allow_anon_registrants = $allow_anon_registrants;
    return $this;
  }

  /**
   * @inheritDoc
   */
  public function getAutoSyncRegistrants() {
    return $this->auto_sync_registrants;
  }

  /**
   * @inheritDoc
   */
  public function setAutoSyncRegistrants($auto_sync_registrants) {
    $this->auto_sync_registrants = $auto_sync_registrants;
    return $this;
  }

  /**
   * @inheritDoc
   */
  public function getAutoAttachUsers() {
    return $this->auto_attach_users;
  }

  /**
   * @inheritDoc
   */
  public function setAutoAttachUsers($auto_attach_users) {
    $this->auto_attach_users = $auto_attach_users;
    return $this;
  }

  /**
   * @inheritDoc
   */
  public function getRegistrantEmailField() {
    return $this->registrant_email_field;
  }

  /**
   * @inheritDoc
   */
  public function setRegistrantEmailField($registrant_email_field) {
    $this->registrant_email_field = $registrant_email_field;
    return $this;
  }

  /**
   * @inheritDoc
   */
  public function getEventStartDateField() {
    return $this->event_start_date_field;
  }

  /**
   * @inheritDoc
   */
  public function setEventStartDateField($event_start_date_field) {
    $this->event_start_date_field = $event_start_date_field;
    return $this;
  }

  /**
   * @inheritDoc
   */
  public function getEventEndDateField() {
    return $this->event_end_date_field;
  }

  /**
   * @inheritDoc
   */
  public function setEventEndDateField($event_end_date_field) {
    $this->event_end_date_field = $event_end_date_field;
    return $this;
  }

}

Members

Namesort descending Modifiers Type Description Overrides
CacheableDependencyTrait::$cacheContexts protected property Cache contexts.
CacheableDependencyTrait::$cacheMaxAge protected property Cache max-age.
CacheableDependencyTrait::$cacheTags protected property Cache tags.
CacheableDependencyTrait::setCacheability protected function Sets cacheability; useful for value object constructors.
ConfigEntityBase::$isUninstalling private property Whether the config is being deleted by the uninstall process.
ConfigEntityBase::$langcode protected property The language code of the entity's default language.
ConfigEntityBase::$originalId protected property The original ID of the configuration entity.
ConfigEntityBase::$status protected property The enabled/disabled status of the configuration entity. 4
ConfigEntityBase::$third_party_settings protected property Third party entity settings.
ConfigEntityBase::$trustedData protected property Trust supplied data and not use configuration schema on save.
ConfigEntityBase::$uuid protected property The UUID for this entity.
ConfigEntityBase::$_core protected property Information maintained by Drupal core about configuration.
ConfigEntityBase::addDependency protected function Overrides \Drupal\Core\Entity\DependencyTrait:addDependency().
ConfigEntityBase::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::preDelete public static function Acts on entities before they are deleted and before hooks are invoked. Overrides EntityBase::preDelete 8
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::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::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::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
RefinableCacheableDependencyTrait::addCacheableDependency public function 1
RefinableCacheableDependencyTrait::addCacheContexts public function
RefinableCacheableDependencyTrait::addCacheTags public function
RefinableCacheableDependencyTrait::mergeCacheMaxAge public function
RngEventType::$allow_anon_registrants protected property Whether or not registrants should be allowed to be added registrations without any other identity entity.
RngEventType::$auto_attach_users protected property Whether or not to automatically attach registrants to user identities by email.
RngEventType::$auto_sync_registrants protected property Whether or not matching field data should be sync'd with identities when a registrant is saved.
RngEventType::$bundle protected property The ID of the event bundle type.
RngEventType::$custom_rules public property Allow event managers to customize default rules.
RngEventType::$default_messages protected property Default messages configured for this event type.
RngEventType::$default_registrant protected property Registrant type for new registrants associated with this event type.
RngEventType::$entity_type protected property The ID of the event entity type.
RngEventType::$event_end_date_field protected property
RngEventType::$event_start_date_field protected property
RngEventType::$fields public property Fields to add to event bundles.
RngEventType::$id protected property The machine name of this event config.
RngEventType::$mirror_operation_to_event_manage public property Mirror update permissions.
RngEventType::$people_types protected property Types of people types allowed to be associated with this event type.
RngEventType::$registrant_email_field protected property An email field on the registrant to use to sync to users.
RngEventType::calculateDependencies public function Calculates dependencies and stores them in the dependency property. Overrides ConfigEntityBase::calculateDependencies
RngEventType::canIdentityTypeCreate public function Whether a identity type can be created. Overrides EventTypeInterface::canIdentityTypeCreate
RngEventType::canIdentityTypeReference public function Whether an existing identity type can be referenced. Overrides EventTypeInterface::canIdentityTypeReference
RngEventType::courierContextCC public static function Create or clean up courier_context if none exist for an entity type. Overrides EventTypeInterface::courierContextCC
RngEventType::delete public function Deletes an entity permanently. Overrides EntityBase::delete
RngEventType::getAllowAnonRegistrants public function @inheritDoc Overrides EventTypeInterface::getAllowAnonRegistrants
RngEventType::getAllowCustomRules public function Whether to allow event managers to customize default rules. Overrides EventTypeInterface::getAllowCustomRules
RngEventType::getAutoAttachUsers public function @inheritDoc Overrides EventTypeInterface::getAutoAttachUsers
RngEventType::getAutoSyncRegistrants public function @inheritDoc Overrides EventTypeInterface::getAutoSyncRegistrants
RngEventType::getDefaultMessages public function Default messages configured for this event type. Overrides EventTypeInterface::getDefaultMessages
RngEventType::getDefaultRegistrantType public function Registrant type for new registrants associated with this event type. Overrides EventTypeInterface::getDefaultRegistrantType
RngEventType::getEventBundle public function Get event bundle. Overrides EventTypeInterface::getEventBundle
RngEventType::getEventEndDateField public function @inheritDoc Overrides EventTypeInterface::getEventEndDateField
RngEventType::getEventEntityTypeId public function Get event entity type ID. Overrides EventTypeInterface::getEventEntityTypeId
RngEventType::getEventManageOperation public function Gets which permission on event entity grants 'event manage' permission. Overrides EventTypeInterface::getEventManageOperation
RngEventType::getEventStartDateField public function @inheritDoc Overrides EventTypeInterface::getEventStartDateField
RngEventType::getIdentityTypeEntityFormMode public function Get the form display mode used when the identity is created inline. Overrides EventTypeInterface::getIdentityTypeEntityFormMode
RngEventType::getIdentityTypeEntityFormModes public function Get the form display modes for creating identities inline. Overrides EventTypeInterface::getIdentityTypeEntityFormModes
RngEventType::getIdentityTypeKey protected function Get the array key of the people type.
RngEventType::getRegistrantEmailField public function @inheritDoc Overrides EventTypeInterface::getRegistrantEmailField
RngEventType::id public function Gets the identifier. Overrides EntityBase::id
RngEventType::onDependencyRemoval public function Informs the entity that entities it depends on will be deleted. Overrides ConfigEntityBase::onDependencyRemoval
RngEventType::postDelete public static function Acts on deleted entities before the delete hook is invoked. Overrides EntityBase::postDelete
RngEventType::postSave public function Acts on a saved entity before the insert or update hook is invoked. Overrides EntityBase::postSave
RngEventType::preSave public function Acts on an entity before the presave hook is invoked. Overrides ConfigEntityBase::preSave
RngEventType::setAllowAnonRegistrants public function @inheritDoc Overrides EventTypeInterface::setAllowAnonRegistrants
RngEventType::setAllowCustomRules public function Set whether event managers can customize default rules. Overrides EventTypeInterface::setAllowCustomRules
RngEventType::setAutoAttachUsers public function @inheritDoc Overrides EventTypeInterface::setAutoAttachUsers
RngEventType::setAutoSyncRegistrants public function @inheritDoc Overrides EventTypeInterface::setAutoSyncRegistrants
RngEventType::setDefaultMessages public function Set default messages for this event type. Overrides EventTypeInterface::setDefaultMessages
RngEventType::setDefaultRegistrantType public function Set registrant type for new registrants associated with this event type. Overrides EventTypeInterface::setDefaultRegistrantType
RngEventType::setEventBundle public function Sets the event bundle. Overrides EventTypeInterface::setEventBundle
RngEventType::setEventEndDateField public function @inheritDoc Overrides EventTypeInterface::setEventEndDateField
RngEventType::setEventEntityTypeId public function Sets the event entity type ID. Overrides EventTypeInterface::setEventEntityTypeId
RngEventType::setEventManageOperation public function Sets operation to mirror from the event entity. Overrides EventTypeInterface::setEventManageOperation
RngEventType::setEventStartDateField public function @inheritDoc Overrides EventTypeInterface::setEventStartDateField
RngEventType::setIdentityTypeCreate public function Set whether an identity type can be created. Overrides EventTypeInterface::setIdentityTypeCreate
RngEventType::setIdentityTypeEntityFormMode public function Set the form display mode used when the identity is created inline. Overrides EventTypeInterface::setIdentityTypeEntityFormMode
RngEventType::setIdentityTypeReference public function Set whether existing identity type can be referenced. Overrides EventTypeInterface::setIdentityTypeReference
RngEventType::setRegistrantEmailField public function @inheritDoc Overrides EventTypeInterface::setRegistrantEmailField
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