You are here

class Registration in RNG - Events and Registrations 3.x

Same name and namespace in other branches
  1. 8.2 src/Entity/Registration.php \Drupal\rng\Entity\Registration
  2. 8 src/Entity/Registration.php \Drupal\rng\Entity\Registration

Defines the registration entity class.

Plugin annotation


@ContentEntityType(
  id = "registration",
  label = @Translation("Registration"),
  bundle_label = @Translation("Registration type"),
  base_table = "registration",
  data_table = "registration_field_data",
  revision_table = "registration_revision",
  revision_data_table = "registration_field_revision",
  translatable = TRUE,
  entity_keys = {
    "id" = "id",
    "revision" = "vid",
    "bundle" = "type",
    "published" = "status",
    "langcode" = "langcode",
    "uuid" = "uuid",
    "uid" = "uid"
  },
  handlers = {
    "views_data" = "Drupal\rng\Views\RegistrationViewsData",
    "view_builder" = "Drupal\Core\Entity\EntityViewBuilder",
    "access" = "Drupal\rng\AccessControl\RegistrationAccessControlHandler",
    "list_builder" = "\Drupal\rng\Lists\RegistrationListBuilder",
    "form" = {
      "default" = "Drupal\rng\Form\RegistrationForm",
      "add" = "Drupal\rng\Form\RegistrationForm",
      "edit" = "Drupal\rng\Form\RegistrationForm",
      "delete" = "Drupal\rng\Form\RegistrationDeleteForm",
      "registrants" = "Drupal\rng\Form\RegistrationRegistrantEditForm"
    },
    "storage" = "Drupal\rng\RegistrationStorage",
  },
  bundle_entity_type = "registration_type",
  admin_permission = "administer registration entity",
  permission_granularity = "bundle",
  links = {
    "canonical" = "/registration/{registration}",
    "edit-form" = "/registration/{registration}/edit",
    "delete-form" = "/registration/{registration}/delete"
  },
  field_ui_base_route = "entity.registration_type.edit_form"
)

Hierarchy

Expanded class hierarchy of Registration

6 files declare their use of Registration
RegistrationController.php in src/Controller/RegistrationController.php
RngMessageRules.php in tests/src/Kernel/RngMessageRules.php
RngRegistrationEntityTest.php in tests/src/Kernel/RngRegistrationEntityTest.php
RngRegistrationTypeTest.php in src/Tests/RngRegistrationTypeTest.php
RngTestTrait.php in src/Tests/RngTestTrait.php

... See full list

1 string reference to 'Registration'
rng.routing.yml in ./rng.routing.yml
rng.routing.yml

File

src/Entity/Registration.php, line 63

Namespace

Drupal\rng\Entity
View source
class Registration extends ContentEntityBase implements RegistrationInterface {
  use EntityChangedTrait;

  /**
   * Internal cache of identities to associate with this rule when it is saved.
   *
   * @var \Drupal\Core\Entity\EntityInterface
   */
  protected $identities_unsaved = [];

  /**
   * {@inheritdoc}
   */
  public function getEvent() {
    return $this
      ->get('event')->entity;
  }

  /**
   * {@inheritDoc}
   */
  public function getEventMeta() {

    // Add group defaults event settings.

    /* @var $event_manager \Drupal\rng\EventManagerInterface */
    $event_manager = \Drupal::service('rng.event_manager');
    return $event_manager
      ->getMeta($this
      ->getEvent());
  }

  /**
   * {@inheritdoc}
   */
  public function setEvent(ContentEntityInterface $entity) {
    $this
      ->set('event', [
      'entity' => $entity,
    ]);
    return $this;
  }

  /**
   * {@inheritdoc}
   */
  public function label() {
    $owner = $this
      ->getOwner();
    $qty = $this
      ->getRegistrantQty();
    $registrations = '';
    if ($qty) {
      $registrations = '[' . $qty . ']';
    }
    if ($owner) {
      return t('@owner @regs', [
        '@owner' => $owner
          ->label(),
        '@regs' => $registrations,
      ]);
    }
    return t('New registration');
  }

  /**
   * {@inheritdoc}
   */
  public function getCreatedTime() {
    return $this
      ->get('created')->value;
  }

  /**
   * {@inheritdoc}
   */
  public function setCreatedTime($timestamp) {
    $this
      ->set('created', $timestamp);
    return $this;
  }

  /**
   * {@inheritdoc}
   */
  public function getChangedTime() {
    return $this
      ->get('changed')->value;
  }

  /**
   * {@inheritdoc}
   */
  public function isConfirmed() {
    return (bool) $this
      ->getEntityKey('published');
  }

  /**
   * {@inheritdoc}
   */
  public function setConfirmed($confirmed) {
    $this
      ->set('status', (bool) $confirmed);
    return $this;
  }

  /**
   * {@inheritdoc}
   */
  public function getOwner() {
    return $this
      ->get('uid')->entity;
  }

  /**
   * {@inheritdoc}
   */
  public function setOwner(UserInterface $account) {
    $this
      ->set('uid', $account
      ->id());
    return $this;
  }

  /**
   * {@inheritdoc}
   */
  public function getOwnerId() {
    return $this
      ->getEntityKey('owner');
  }

  /**
   * {@inheritdoc}
   */
  public function setOwnerId($uid) {
    $this
      ->set('uid', $uid);
    return $this;
  }

  /**
   * {@inheritdoc}
   */
  public function getRegistrantIds() {
    return $this->registrant_ids = \Drupal::entityQuery('registrant')
      ->condition('registration', $this
      ->id(), '=')
      ->execute();
  }

  /**
   * {@inheritdoc}
   */
  public function getRegistrants() {
    if ($this
      ->getRegistrantQty()) {
      $this
        ->createStubs();
    }
    $registrants = \Drupal::entityTypeManager()
      ->getStorage('registrant')
      ->loadMultiple($this
      ->getRegistrantIds());
    if (!count($registrants)) {

      /** @var \Drupal\rng\RegistrantFactoryInterface $registrant_factory */
      $registrant_factory = \Drupal::service('rng.registrant.factory');

      // Always return at least one, even if it's not saved. This should only
      // run if there is not a defined number of registrants for this
      // registration, and no existing registrants.
      $registrant = $registrant_factory
        ->createRegistrant([
        'event' => $this
          ->getEvent(),
      ]);
      $registrant
        ->setRegistration($this);
      $registrants[] = $registrant;
    }
    return $registrants;
  }

  /**
   * {@inheritdoc}
   */
  public function hasIdentity(EntityInterface $identity) {
    foreach ($this->identities_unsaved as $identity_unsaved) {
      if ($identity == $identity_unsaved) {
        return TRUE;
      }
    }
    foreach ($this
      ->getRegistrants() as $registrant) {
      if ($registrant
        ->hasIdentity($identity)) {
        return TRUE;
      }
    }
    return FALSE;
  }

  /**
   * {@inheritdoc}
   */
  public function addIdentity(EntityInterface $identity) {
    if ($this
      ->hasIdentity($identity)) {

      // Identity already exists on this registration.
      throw new \Exception('Duplicate identity on registration');
    }
    if (!$this
      ->canAddRegistrants()) {
      throw new MaxRegistrantsExceededException('Cannot add another registrant to this registration.');
    }
    $this->identities_unsaved[] = $identity;
    return $this;
  }

  /**
   * {@inheritdoc}
   */
  public function getGroups() {
    return $this->groups
      ->referencedEntities();
  }

  /**
   * {@inheritdoc}
   */
  public function addGroup(GroupInterface $group) {

    // Do not add the group if it is already related.
    if (!in_array($group, $this
      ->getGroups())) {
      if ($group
        ->getEvent() != $this
        ->getEvent()) {
        throw new \Exception('Group and registration events do not match.');
      }
      $this->groups
        ->appendItem($group);
    }
    return $this;
  }

  /**
   * {@inheritdoc}
   */
  public function removeGroup($group_id) {
    foreach ($this->groups
      ->getValue() as $key => $value) {
      if ($value['target_id'] == $group_id) {
        $this->groups
          ->removeItem($key);
      }
    }
    return $this;
  }

  /**
   * {@inheritdoc}
   */
  public static function baseFieldDefinitions(EntityTypeInterface $entity_type) {
    $fields['id'] = BaseFieldDefinition::create('integer')
      ->setLabel(t('Registration ID'))
      ->setDescription(t('The registration ID.'))
      ->setReadOnly(TRUE)
      ->setSetting('unsigned', TRUE);
    $fields['uuid'] = BaseFieldDefinition::create('uuid')
      ->setLabel(t('UUID'))
      ->setDescription(t('The registration UUID.'))
      ->setReadOnly(TRUE);
    $fields['vid'] = BaseFieldDefinition::create('integer')
      ->setLabel(t('Revision ID'))
      ->setDescription(t('The registration revision ID.'))
      ->setReadOnly(TRUE)
      ->setSetting('unsigned', TRUE);
    $fields['status'] = BaseFieldDefinition::create('boolean')
      ->setLabel(new TranslatableMarkup('Confirmed'))
      ->setRevisionable(TRUE)
      ->setTranslatable(TRUE)
      ->setDefaultValue(TRUE)
      ->setDisplayOptions('form', [
      'type' => 'boolean_checkbox',
      'settings' => [
        'display_label' => TRUE,
      ],
      'weight' => 90,
    ])
      ->setDisplayConfigurable('form', TRUE);
    $fields['type'] = BaseFieldDefinition::create('entity_reference')
      ->setLabel(t('Type'))
      ->setDescription(t('The registration type.'))
      ->setSetting('target_type', 'registration_type')
      ->setReadOnly(TRUE);
    $fields['langcode'] = BaseFieldDefinition::create('language')
      ->setLabel(t('Language code'))
      ->setDescription(t('The registration language code.'))
      ->setRevisionable(TRUE);
    $fields['event'] = BaseFieldDefinition::create('dynamic_entity_reference')
      ->setLabel(t('Event'))
      ->setDescription(t('The event for the registration.'))
      ->setSetting('exclude_entity_types', 'true')
      ->setSetting('entity_type_ids', [
      'registrant',
      'registration',
    ])
      ->setDescription(t('The relationship between this registration and an event.'))
      ->setRevisionable(TRUE)
      ->setReadOnly(TRUE);
    $fields['groups'] = BaseFieldDefinition::create('entity_reference')
      ->setLabel(t('Groups'))
      ->setCardinality(BaseFieldDefinition::CARDINALITY_UNLIMITED)
      ->setDescription(t('The groups the registration is assigned.'))
      ->setSetting('target_type', 'registration_group')
      ->addConstraint('RegistrationGroupSibling');
    $fields['created'] = BaseFieldDefinition::create('created')
      ->setLabel(t('Authored on'))
      ->setDescription(t('Time the Registration was created.'))
      ->setTranslatable(FALSE)
      ->setRevisionable(FALSE);
    $fields['changed'] = BaseFieldDefinition::create('changed')
      ->setLabel(t('Updated on'))
      ->setDescription(t('The time Registration was last updated.'))
      ->setTranslatable(TRUE)
      ->setRevisionable(TRUE);
    $fields['uid'] = BaseFieldDefinition::create('entity_reference')
      ->setLabel(t('Owner'))
      ->setDescription(t('The owner of the registration.'))
      ->setSetting('target_type', 'user')
      ->setSetting('handler', 'default')
      ->setDefaultValueCallback('Drupal\\rng\\Entity\\Registration::getCurrentUserId')
      ->setTranslatable(TRUE)
      ->setDisplayConfigurable('view', TRUE)
      ->setDisplayOptions('form', [
      'type' => 'entity_reference_autocomplete',
      'weight' => 5,
    ])
      ->setDisplayConfigurable('form', TRUE);

    /**
     * Optional registrant qty field, used for rendering the registrant form. If
     * set and not zero, users cannot add more than this number of registrants
     * to the registration.
     */
    $fields['registrant_qty'] = BaseFieldDefinition::create('integer')
      ->setLabel(t('Registrant Qty'))
      ->setDescription(t('Number of registrants on this registration'))
      ->setDefaultValue(0)
      ->setDisplayConfigurable('form', TRUE)
      ->setDisplayConfigurable('view', TRUE)
      ->setTranslatable(TRUE)
      ->setRevisionable(TRUE);
    return $fields;
  }

  /**
   * {@inheritdoc}
   */
  public function preSave(EntityStorageInterface $storage) {
    parent::preSave($storage);
    if (!$this
      ->getEvent() instanceof ContentEntityBase) {
      throw new EntityMalformedException('Invalid or missing event on registration.');
    }
    $registrants = $this
      ->getRegistrantIds();
    $count = $this
      ->getRegistrantQty();
    if (!empty($count) && $count < count($registrants)) {
      throw new MaxRegistrantsExceededException('Too many registrants on this registration.');
    }
    $event_meta = $this
      ->getEventMeta();
    if ($this
      ->isNew()) {
      foreach ($event_meta
        ->getDefaultGroups() as $group) {
        $this
          ->addGroup($group);
      }
    }
  }

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

    /** @var \Drupal\rng\RegistrantFactoryInterface $registrant_factory */
    $registrant_factory = \Drupal::service('rng.registrant.factory');
    foreach ($this->identities_unsaved as $k => $identity) {
      $registrant = $registrant_factory
        ->createRegistrant([
        'event' => $this
          ->getEvent(),
      ]);
      $registrant
        ->setRegistration($this)
        ->setIdentity($identity)
        ->save();
      unset($this->identities_unsaved[$k]);
    }
    $this
      ->createStubs();
  }
  protected function createStubs() {
    $stub_count = $this
      ->getRegistrantQty();
    if ($stub_count && $this
      ->canAddRegistrants()) {

      /** @var \Drupal\rng\RegistrantFactoryInterface $registrant_factory */
      $registrant_factory = \Drupal::service('rng.registrant.factory');
      $registrant_count = count($this
        ->getRegistrantIds());
      $stub_count -= $registrant_count;
      while ($stub_count) {
        $registrant = $registrant_factory
          ->createRegistrant([
          'event' => $this
            ->getEvent(),
        ]);
        $registrant
          ->setRegistration($this)
          ->save();
        $stub_count--;
      }
    }
  }

  /**
   * {@inheritdoc}
   */
  public static function preDelete(EntityStorageInterface $storage, array $entities) {
    $registrant_storage = \Drupal::entityTypeManager()
      ->getStorage('registrant');

    /** @var \Drupal\rng\RegistrationInterface $registration */
    foreach ($entities as $registration) {

      // Delete associated registrants.
      $ids = $registrant_storage
        ->getQuery()
        ->condition('registration', $registration
        ->id(), '=')
        ->execute();
      $registrants = $registrant_storage
        ->loadMultiple($ids);
      $registrant_storage
        ->delete($registrants);
    }
    parent::preDelete($storage, $entities);
  }

  /**
   * @inheritDoc
   */
  public function getRegistrantQty() {
    return $this
      ->get('registrant_qty')->value;
  }

  /**
   * @inheritDoc
   */
  public function setRegistrantQty($qty) {
    $registrants = $this
      ->getRegistrantIds();
    if ($qty > 0) {
      if (count($registrants) > $qty) {
        throw new MaxRegistrantsExceededException('Cannot set registrant qty below number of current registrants.');
      }
      $event_meta = $this
        ->getEventMeta();
      $max = $event_meta
        ->getRegistrantsMaximum();
      if (!empty($max) && $max > -1 && $qty > $max) {
        throw new MaxRegistrantsExceededException('Cannot set registrations above event maximum');
      }
    }
    $this
      ->set('registrant_qty', $qty);
    return $this;
  }

  /**
   * @inheritDoc
   */
  public function canAddRegistrants() {
    $registrants = $this
      ->getRegistrantIds();
    $qty = $this
      ->getRegistrantQty();
    if ($qty) {
      return $qty > count($registrants);
    }
    return TRUE;
  }

  /**
   * Default value callback for 'uid' base field definition.
   *
   * @see ::baseFieldDefinitions()
   *
   * @return array
   *   An array of default values.
   */
  public static function getCurrentUserId() {
    return [
      \Drupal::currentUser()
        ->id(),
    ];
  }

  /**
   * @inheritDoc
   */
  public function getDateString() {
    $event_meta = $this
      ->getEventMeta();
    return $event_meta
      ->getDateString();
  }

}

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.
ContentEntityBase::$activeLangcode protected property Language code identifying the entity active language.
ContentEntityBase::$defaultLangcode protected property Local cache for the default language code.
ContentEntityBase::$defaultLangcodeKey protected property The default langcode entity key.
ContentEntityBase::$enforceRevisionTranslationAffected protected property Whether the revision translation affected flag has been enforced.
ContentEntityBase::$entityKeys protected property Holds untranslatable entity keys such as the ID, bundle, and revision ID.
ContentEntityBase::$fieldDefinitions protected property Local cache for field definitions.
ContentEntityBase::$fields protected property The array of fields, each being an instance of FieldItemListInterface.
ContentEntityBase::$fieldsToSkipFromTranslationChangesCheck protected static property Local cache for fields to skip from the checking for translation changes.
ContentEntityBase::$isDefaultRevision protected property Indicates whether this is the default revision.
ContentEntityBase::$langcodeKey protected property The language entity key.
ContentEntityBase::$languages protected property Local cache for the available language objects.
ContentEntityBase::$loadedRevisionId protected property The loaded revision ID before the new revision was set.
ContentEntityBase::$newRevision protected property Boolean indicating whether a new revision should be created on save.
ContentEntityBase::$revisionTranslationAffectedKey protected property The revision translation affected entity key.
ContentEntityBase::$translatableEntityKeys protected property Holds translatable entity keys such as the label.
ContentEntityBase::$translationInitialize protected property A flag indicating whether a translation object is being initialized.
ContentEntityBase::$translations protected property An array of entity translation metadata.
ContentEntityBase::$validated protected property Whether entity validation was performed.
ContentEntityBase::$validationRequired protected property Whether entity validation is required before saving the entity.
ContentEntityBase::$values protected property The plain data values of the contained fields.
ContentEntityBase::access public function Checks data value access. Overrides EntityBase::access 1
ContentEntityBase::addTranslation public function Adds a new translation to the translatable object. Overrides TranslatableInterface::addTranslation
ContentEntityBase::bundle public function Gets the bundle of the entity. Overrides EntityBase::bundle
ContentEntityBase::bundleFieldDefinitions public static function Provides field definitions for a specific bundle. Overrides FieldableEntityInterface::bundleFieldDefinitions 4
ContentEntityBase::clearTranslationCache protected function Clear entity translation object cache to remove stale references.
ContentEntityBase::createDuplicate public function Creates a duplicate of the entity. Overrides EntityBase::createDuplicate 1
ContentEntityBase::get public function Gets a field item list. Overrides FieldableEntityInterface::get
ContentEntityBase::getEntityKey protected function Gets the value of the given entity key, if defined. 1
ContentEntityBase::getFieldDefinition public function Gets the definition of a contained field. Overrides FieldableEntityInterface::getFieldDefinition
ContentEntityBase::getFieldDefinitions public function Gets an array of field definitions of all contained fields. Overrides FieldableEntityInterface::getFieldDefinitions
ContentEntityBase::getFields public function Gets an array of all field item lists. Overrides FieldableEntityInterface::getFields
ContentEntityBase::getFieldsToSkipFromTranslationChangesCheck protected function Returns an array of field names to skip in ::hasTranslationChanges. 1
ContentEntityBase::getIterator public function
ContentEntityBase::getLanguages protected function
ContentEntityBase::getLoadedRevisionId public function Gets the loaded Revision ID of the entity. Overrides RevisionableInterface::getLoadedRevisionId
ContentEntityBase::getRevisionId public function Gets the revision identifier of the entity. Overrides RevisionableInterface::getRevisionId
ContentEntityBase::getTranslatableFields public function Gets an array of field item lists for translatable fields. Overrides FieldableEntityInterface::getTranslatableFields
ContentEntityBase::getTranslatedField protected function Gets a translated field.
ContentEntityBase::getTranslation public function Gets a translation of the data. Overrides TranslatableInterface::getTranslation
ContentEntityBase::getTranslationLanguages public function Returns the languages the data is translated to. Overrides TranslatableInterface::getTranslationLanguages
ContentEntityBase::getTranslationStatus public function Returns the translation status. Overrides TranslationStatusInterface::getTranslationStatus
ContentEntityBase::getUntranslated public function Returns the translatable object referring to the original language. Overrides TranslatableInterface::getUntranslated
ContentEntityBase::hasField public function Determines whether the entity has a field with the given name. Overrides FieldableEntityInterface::hasField
ContentEntityBase::hasTranslation public function Checks there is a translation for the given language code. Overrides TranslatableInterface::hasTranslation
ContentEntityBase::hasTranslationChanges public function Determines if the current translation of the entity has unsaved changes. Overrides TranslatableInterface::hasTranslationChanges
ContentEntityBase::id public function Gets the identifier. Overrides EntityBase::id
ContentEntityBase::initializeTranslation protected function Instantiates a translation object for an existing translation.
ContentEntityBase::isDefaultRevision public function Checks if this entity is the default revision. Overrides RevisionableInterface::isDefaultRevision
ContentEntityBase::isDefaultTranslation public function Checks whether the translation is the default one. Overrides TranslatableInterface::isDefaultTranslation
ContentEntityBase::isDefaultTranslationAffectedOnly public function Checks if untranslatable fields should affect only the default translation. Overrides TranslatableRevisionableInterface::isDefaultTranslationAffectedOnly
ContentEntityBase::isLatestRevision public function Checks if this entity is the latest revision. Overrides RevisionableInterface::isLatestRevision
ContentEntityBase::isLatestTranslationAffectedRevision public function Checks whether this is the latest revision affecting this translation. Overrides TranslatableRevisionableInterface::isLatestTranslationAffectedRevision
ContentEntityBase::isNewRevision public function Determines whether a new revision should be created on save. Overrides RevisionableInterface::isNewRevision
ContentEntityBase::isNewTranslation public function Checks whether the translation is new. Overrides TranslatableInterface::isNewTranslation
ContentEntityBase::isRevisionTranslationAffected public function Checks whether the current translation is affected by the current revision. Overrides TranslatableRevisionableInterface::isRevisionTranslationAffected
ContentEntityBase::isRevisionTranslationAffectedEnforced public function Checks if the revision translation affected flag value has been enforced. Overrides TranslatableRevisionableInterface::isRevisionTranslationAffectedEnforced
ContentEntityBase::isTranslatable public function Returns the translation support status. Overrides TranslatableInterface::isTranslatable
ContentEntityBase::isValidationRequired public function Checks whether entity validation is required before saving the entity. Overrides FieldableEntityInterface::isValidationRequired
ContentEntityBase::language public function Gets the language of the entity. Overrides EntityBase::language
ContentEntityBase::onChange public function Reacts to changes to a field. Overrides FieldableEntityInterface::onChange
ContentEntityBase::postCreate public function Acts on a created entity before hooks are invoked. Overrides EntityBase::postCreate
ContentEntityBase::preSaveRevision public function Acts on a revision before it gets saved. Overrides RevisionableInterface::preSaveRevision 3
ContentEntityBase::referencedEntities public function Gets a list of entities referenced by this entity. Overrides EntityBase::referencedEntities 1
ContentEntityBase::removeTranslation public function Removes the translation identified by the given language code. Overrides TranslatableInterface::removeTranslation
ContentEntityBase::set public function Sets a field value. Overrides FieldableEntityInterface::set
ContentEntityBase::setDefaultLangcode protected function Populates the local cache for the default language code.
ContentEntityBase::setNewRevision public function Enforces an entity to be saved as a new revision. Overrides RevisionableInterface::setNewRevision
ContentEntityBase::setRevisionTranslationAffected public function Marks the current revision translation as affected. Overrides TranslatableRevisionableInterface::setRevisionTranslationAffected
ContentEntityBase::setRevisionTranslationAffectedEnforced public function Enforces the revision translation affected flag value. Overrides TranslatableRevisionableInterface::setRevisionTranslationAffectedEnforced
ContentEntityBase::setValidationRequired public function Sets whether entity validation is required before saving the entity. Overrides FieldableEntityInterface::setValidationRequired
ContentEntityBase::toArray public function Gets an array of all property values. Overrides EntityBase::toArray
ContentEntityBase::updateFieldLangcodes protected function Updates language for already instantiated fields.
ContentEntityBase::updateLoadedRevisionId public function Updates the loaded Revision ID with the revision ID. Overrides RevisionableInterface::updateLoadedRevisionId
ContentEntityBase::updateOriginalValues public function Updates the original values with the interim changes.
ContentEntityBase::uuid public function Gets the entity UUID (Universally Unique Identifier). Overrides EntityBase::uuid
ContentEntityBase::validate public function Validates the currently set values. Overrides FieldableEntityInterface::validate 1
ContentEntityBase::wasDefaultRevision public function Checks whether the entity object was a default revision when it was saved. Overrides RevisionableInterface::wasDefaultRevision
ContentEntityBase::__clone public function Magic method: Implements a deep clone.
ContentEntityBase::__construct public function Constructs an Entity object. Overrides EntityBase::__construct
ContentEntityBase::__get public function Implements the magic method for getting object properties.
ContentEntityBase::__isset public function Implements the magic method for isset().
ContentEntityBase::__set public function Implements the magic method for setting object properties.
ContentEntityBase::__sleep public function Overrides EntityBase::__sleep
ContentEntityBase::__unset public function Implements the magic method for unset().
DependencySerializationTrait::$_entityStorages protected property
DependencySerializationTrait::$_serviceIds protected property
DependencySerializationTrait::__sleep public function Aliased as: traitSleep 2
DependencySerializationTrait::__wakeup public function 2
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::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::getCacheTagsToInvalidate public function Returns the cache tags that should be used to invalidate caches. Overrides EntityInterface::getCacheTagsToInvalidate 4
EntityBase::getConfigDependencyKey public function Gets the key that is used to store configuration dependencies. Overrides EntityInterface::getConfigDependencyKey
EntityBase::getConfigDependencyName public function Gets the configuration dependency name. Overrides EntityInterface::getConfigDependencyName 1
EntityBase::getConfigTarget public function Gets the configuration target identifier for the entity. Overrides EntityInterface::getConfigTarget 1
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::getOriginalId public function Gets the original ID. Overrides EntityInterface::getOriginalId 1
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::invalidateTagsOnDelete protected static function Invalidates an entity's cache tags upon delete. 1
EntityBase::invalidateTagsOnSave protected function Invalidates an entity's cache tags upon save. 1
EntityBase::isNew public function Determines whether the entity is new. Overrides EntityInterface::isNew 2
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::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::preCreate public static function Changes the values of an entity before it is created. Overrides EntityInterface::preCreate 7
EntityBase::save public function Saves an entity permanently. Overrides EntityInterface::save 3
EntityBase::setOriginalId public function Sets the original ID. Overrides EntityInterface::setOriginalId 1
EntityBase::toLink public function Generates the HTML for a link to this entity. Overrides EntityInterface::toLink
EntityBase::toUrl public function Gets the URL object for the entity. Overrides EntityInterface::toUrl 2
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::uuidGenerator protected function Gets the UUID generator.
EntityChangedTrait::getChangedTimeAcrossTranslations public function Returns the timestamp of the last entity change across all translations.
EntityChangedTrait::setChangedTime public function Sets the timestamp of the last entity change for the current translation.
EntityChangesDetectionTrait::getFieldsToSkipFromTranslationChangesCheck protected function Returns an array of field names to skip when checking for changes. Aliased as: traitGetFieldsToSkipFromTranslationChangesCheck
RefinableCacheableDependencyTrait::addCacheableDependency public function 1
RefinableCacheableDependencyTrait::addCacheContexts public function
RefinableCacheableDependencyTrait::addCacheTags public function
RefinableCacheableDependencyTrait::mergeCacheMaxAge public function
Registration::$identities_unsaved protected property Internal cache of identities to associate with this rule when it is saved.
Registration::addGroup public function Add a group to the registration. Overrides RegistrationInterface::addGroup
Registration::addIdentity public function Shortcut to add a registrant entity. Overrides RegistrationInterface::addIdentity
Registration::baseFieldDefinitions public static function Provides base field definitions for an entity type. Overrides ContentEntityBase::baseFieldDefinitions
Registration::canAddRegistrants public function @inheritDoc Overrides RegistrationInterface::canAddRegistrants
Registration::createStubs protected function
Registration::getChangedTime public function Gets the timestamp of the last entity change for the current translation. Overrides EntityChangedTrait::getChangedTime
Registration::getCreatedTime public function Returns the registration creation timestamp. Overrides RegistrationInterface::getCreatedTime
Registration::getCurrentUserId public static function Default value callback for 'uid' base field definition.
Registration::getDateString public function @inheritDoc Overrides RegistrationInterface::getDateString
Registration::getEvent public function Get associated event. Overrides RegistrationInterface::getEvent
Registration::getEventMeta public function Get the event meta object for this event. Overrides RegistrationInterface::getEventMeta
Registration::getGroups public function Get groups for the registration. Overrides RegistrationInterface::getGroups
Registration::getOwner public function Get the User object that owns this registration. Overrides RegistrationInterface::getOwner
Registration::getOwnerId public function Get the owner uid of this registration. Overrides RegistrationInterface::getOwnerId
Registration::getRegistrantIds public function Get registrants IDs for the registration. Overrides RegistrationInterface::getRegistrantIds
Registration::getRegistrantQty public function @inheritDoc Overrides RegistrationInterface::getRegistrantQty
Registration::getRegistrants public function Get registrants for the registration. Overrides RegistrationInterface::getRegistrants
Registration::hasIdentity public function Searches registrants on this registration for an identity. Overrides RegistrationInterface::hasIdentity
Registration::isConfirmed public function Check to see if this registration is confirmed. Overrides RegistrationInterface::isConfirmed
Registration::label public function Gets the label of the entity. Overrides ContentEntityBase::label
Registration::postSave public function Acts on a saved entity before the insert or update hook is invoked. Overrides ContentEntityBase::postSave
Registration::preDelete public static function Acts on entities before they are deleted and before hooks are invoked. Overrides EntityBase::preDelete
Registration::preSave public function Acts on an entity before the presave hook is invoked. Overrides ContentEntityBase::preSave
Registration::removeGroup public function Remove a group from the registration. Overrides RegistrationInterface::removeGroup
Registration::setConfirmed public function Set the registration to confirmed (or unconfirmed). Overrides RegistrationInterface::setConfirmed
Registration::setCreatedTime public function Sets the registration creation timestamp. Overrides RegistrationInterface::setCreatedTime
Registration::setEvent public function Set associated event. Overrides RegistrationInterface::setEvent
Registration::setOwner public function Set the owner of the registration to object. Overrides RegistrationInterface::setOwner
Registration::setOwnerId public function Set the owner of this registration by UID. Overrides RegistrationInterface::setOwnerId
Registration::setRegistrantQty public function @inheritDoc Overrides RegistrationInterface::setRegistrantQty
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
TranslationStatusInterface::TRANSLATION_CREATED constant Status code identifying a newly created translation.
TranslationStatusInterface::TRANSLATION_EXISTING constant Status code identifying an existing translation.
TranslationStatusInterface::TRANSLATION_REMOVED constant Status code identifying a removed translation.