class EasyEmail in Easy Email 8
Same name and namespace in other branches
- 2.0.x src/Entity/EasyEmail.php \Drupal\easy_email\Entity\EasyEmail
Defines the Email entity.
Plugin annotation
@ContentEntityType(
id = "easy_email",
label = @Translation("Email"),
bundle_label = @Translation("Email Template"),
label_collection = @Translation("Email Log"),
handlers = {
"event" = "Drupal\easy_email\Event\EasyEmailEvent",
"storage" = "Drupal\easy_email\EasyEmailStorage",
"view_builder" = "Drupal\Core\Entity\EntityViewBuilder",
"list_builder" = "Drupal\easy_email\EasyEmailListBuilder",
"views_data" = "Drupal\easy_email\Entity\EasyEmailViewsData",
"translation" = "Drupal\easy_email\EasyEmailTranslationHandler",
"form" = {
"default" = "Drupal\easy_email\Form\EasyEmailForm",
"add" = "Drupal\easy_email\Form\EasyEmailForm",
"edit" = "Drupal\easy_email\Form\EasyEmailForm",
"delete" = "Drupal\easy_email\Form\EasyEmailDeleteForm",
},
"access" = "Drupal\easy_email\EasyEmailAccessControlHandler",
"route_provider" = {
"html" = "Drupal\easy_email\EasyEmailHtmlRouteProvider",
},
},
base_table = "easy_email",
data_table = "easy_email_field_data",
revision_table = "easy_email_revision",
revision_data_table = "easy_email_field_revision",
translatable = TRUE,
admin_permission = "administer email entities",
entity_keys = {
"id" = "id",
"revision" = "vid",
"bundle" = "type",
"label" = "id",
"uuid" = "uuid",
"uid" = "creator_uid",
"langcode" = "langcode",
"status" = "status",
},
revision_metadata_keys = {
"revision_default" = "revision_default",
"revision_user" = "revision_user",
"revision_created" = "revision_created",
"revision_log_message" = "revision_log_message",
},
links = {
"canonical" = "/admin/content/email/{easy_email}",
"preview" = "/admin/content/email/{easy_email}/preview",
"preview_plain" = "/admin/content/email/{easy_email}/preview-plain",
"add-page" = "/admin/content/email/add",
"add-form" = "/admin/content/email/add/{easy_email_type}",
"edit-form" = "/admin/content/email/{easy_email}/edit",
"delete-form" = "/admin/content/email/{easy_email}/delete",
"version-history" = "/admin/content/email/{easy_email}/revisions",
"revision" = "/admin/content/email/{easy_email}/revisions/{easy_email_revision}/view",
"revision_revert" = "/admin/content/email/{easy_email}/revisions/{easy_email_revision}/revert",
"revision_delete" = "/admin/content/email/{easy_email}/revisions/{easy_email_revision}/delete",
"translation_revert" = "/admin/content/email/{easy_email}/revisions/{easy_email_revision}/revert/{langcode}",
"collection" = "/admin/content/email",
},
bundle_entity_type = "easy_email_type",
field_ui_base_route = "entity.easy_email_type.edit_form"
)
Hierarchy
- class \Drupal\Core\Entity\EntityBase implements EntityInterface uses RefinableCacheableDependencyTrait, DependencySerializationTrait
- class \Drupal\Core\Entity\ContentEntityBase implements \Drupal\Core\Entity\IteratorAggregate, ContentEntityInterface, TranslationStatusInterface uses EntityChangesDetectionTrait, SynchronizableEntityTrait
- class \Drupal\Core\Entity\RevisionableContentEntityBase implements RevisionLogInterface uses RevisionLogEntityTrait
- class \Drupal\easy_email\Entity\EasyEmail implements EasyEmailInterface uses EntityChangedTrait
- class \Drupal\Core\Entity\RevisionableContentEntityBase implements RevisionLogInterface uses RevisionLogEntityTrait
- class \Drupal\Core\Entity\ContentEntityBase implements \Drupal\Core\Entity\IteratorAggregate, ContentEntityInterface, TranslationStatusInterface uses EntityChangesDetectionTrait, SynchronizableEntityTrait
Expanded class hierarchy of EasyEmail
File
- src/
Entity/ EasyEmail.php, line 83
Namespace
Drupal\easy_email\EntityView source
class EasyEmail extends RevisionableContentEntityBase implements EasyEmailInterface {
use EntityChangedTrait;
/**
* @var array
*/
protected $evaluatedAttachments;
/**
* {@inheritdoc}
*/
public static function preCreate(EntityStorageInterface $storage_controller, array &$values) {
/** @var \Drupal\easy_email\EasyEmailStorageInterface $storage_controller */
parent::preCreate($storage_controller, $values);
/** @var \Drupal\easy_email\Entity\EasyEmailTypeInterface $easy_email_type */
$easy_email_type = $storage_controller
->getEmailTypeStorage()
->load($values['type']);
$values += [
'creator_uid' => \Drupal::currentUser()
->id(),
'key' => $easy_email_type
->getKey(),
'from_name' => $easy_email_type
->getFromName(),
'from_address' => $easy_email_type
->getFromAddress(),
'reply_to' => $easy_email_type
->getReplyToAddress(),
'subject' => $easy_email_type
->getSubject(),
'body_html' => $easy_email_type
->getBodyHtml(),
'body_plain' => $easy_email_type
->getBodyPlain(),
'inbox_preview' => $easy_email_type
->getInboxPreview(),
'recipient_address' => $easy_email_type
->getRecipient(),
'cc_address' => $easy_email_type
->getCc(),
'bcc_address' => $easy_email_type
->getBcc(),
'attachment_path' => $easy_email_type
->getAttachment(),
];
}
/**
* {@inheritdoc}
*/
protected function urlRouteParameters($rel) {
$uri_route_parameters = parent::urlRouteParameters($rel);
if ($rel === 'revision_revert' && $this instanceof RevisionableInterface) {
$uri_route_parameters[$this
->getEntityTypeId() . '_revision'] = $this
->getRevisionId();
}
elseif ($rel === 'revision_delete' && $this instanceof RevisionableInterface) {
$uri_route_parameters[$this
->getEntityTypeId() . '_revision'] = $this
->getRevisionId();
}
return $uri_route_parameters;
}
/**
* {@inheritdoc}
*/
public function preSave(EntityStorageInterface $storage) {
parent::preSave($storage);
foreach (array_keys($this
->getTranslationLanguages()) as $langcode) {
$translation = $this
->getTranslation($langcode);
// If no owner has been set explicitly, make the anonymous user the owner.
if (!$translation
->getCreator()) {
$translation
->setCreatorId(0);
}
}
// If no revision author has been set explicitly, make the easy_email owner the
// revision author.
if (!$this
->getRevisionUser()) {
$this
->setRevisionUserId($this
->getCreatorId());
}
}
/**
* {@inheritdoc}
*/
public function getCreatedTime() {
return $this
->get('created')->value;
}
/**
* {@inheritdoc}
*/
public function setCreatedTime($timestamp) {
$this
->set('created', $timestamp);
return $this;
}
/**
* {@inheritdoc}
*/
public function getCreator() {
return $this
->get('creator_uid')->entity;
}
/**
* {@inheritdoc}
*/
public function getCreatorId() {
return $this
->get('creator_uid')->target_id;
}
/**
* {@inheritdoc}
*/
public function setCreatorId($uid) {
$this
->set('creator_uid', $uid);
return $this;
}
/**
* {@inheritdoc}
*/
public function setCreator(UserInterface $account) {
$this
->set('creator_uid', $account
->id());
return $this;
}
/**
* @inheritDoc
*/
public function getKey() {
return $this
->get('key')->value;
}
/**
* @inheritDoc
*/
public function setKey($key) {
$this
->set('key', $key);
return $this;
}
/**
* @inheritDoc
*/
public function getRecipients() {
if ($this
->hasField('recipient_uid')) {
return $this
->get('recipient_uid')
->referencedEntities();
}
return NULL;
}
/**
* @inheritDoc
*/
public function setRecipients($accounts) {
if ($this
->hasField('recipient_uid')) {
$this
->set('recipient_uid', $accounts);
}
return $this;
}
/**
* @inheritDoc
*/
public function getRecipientIds() {
if ($this
->hasField('recipient_uid')) {
return $this
->getEntityReferenceIds($this
->get('recipient_uid'));
}
return [];
}
/**
* @inheritDoc
*/
public function setRecipientIds($uids) {
if ($this
->hasField('recipient_uid')) {
$this
->set('recipient_uid', $uids);
}
return $this;
}
/**
* @inheritDoc
*/
public function addRecipient($uid) {
if ($this
->hasField('recipient_uid')) {
return $this
->addEntityReferenceById($uid, 'recipient_uid');
}
return $this;
}
/**
* @inheritDoc
*/
public function removeRecipient($uid) {
if ($this
->hasField('recipient_uid')) {
return $this
->removeEntityReferenceById($uid, 'recipient_uid');
}
return $this;
}
/**
* @inheritDoc
*/
public function getRecipientAddresses() {
return $this
->getListTextValues($this
->get('recipient_address'));
}
/**
* @inheritDoc
*/
public function setRecipientAddresses($addresses) {
$this
->set('recipient_address', $addresses);
return $this;
}
/**
* @inheritDoc
*/
public function addRecipientAddress($address) {
return $this
->addTextValueToList($address, 'recipient_address');
}
/**
* @inheritDoc
*/
public function removeRecipientAddress($address) {
return $this
->removeTextValueFromList($address, 'recipient_address');
}
/**
* @inheritDoc
*/
public function getCC() {
if ($this
->hasField('cc_uid')) {
return $this
->get('cc_uid')
->referencedEntities();
}
return NULL;
}
/**
* @inheritDoc
*/
public function setCC($accounts) {
if ($this
->hasField('cc_uid')) {
$this
->set('cc_uid', $accounts);
}
return $this;
}
/**
* @inheritDoc
*/
public function getCCIds() {
if ($this
->hasField('cc_uid')) {
return $this
->getEntityReferenceIds($this
->get('cc_uid'));
}
return [];
}
/**
* @inheritDoc
*/
public function setCCIds($uids) {
if ($this
->hasField('cc_uid')) {
$this
->set('cc_uid', $uids);
}
return $this;
}
/**
* @inheritDoc
*/
public function addCC($uid) {
if ($this
->hasField('cc_uid')) {
return $this
->addEntityReferenceById($uid, 'cc_uid');
}
return $this;
}
/**
* @inheritDoc
*/
public function removeCC($uid) {
if ($this
->hasField('cc_uid')) {
return $this
->removeEntityReferenceById($uid, 'cc_uid');
}
return $this;
}
/**
* @inheritDoc
*/
public function getCCAddresses() {
if ($this
->hasField('cc_address')) {
return $this
->getListTextValues($this
->get('cc_address'));
}
return NULL;
}
/**
* @inheritDoc
*/
public function setCCAddresses($addresses) {
if ($this
->hasField('cc_address')) {
$this
->set('cc_address', $addresses);
}
return $this;
}
/**
* @inheritDoc
*/
public function addCCAddress($address) {
if ($this
->hasField('cc_address')) {
return $this
->addTextValueToList($address, 'cc_address');
}
return $this;
}
/**
* @inheritDoc
*/
public function removeCCAddress($address) {
if ($this
->hasField('cc_address')) {
return $this
->removeTextValueFromList($address, 'cc_address');
}
return $this;
}
/**
* @inheritDoc
*/
public function getBCC() {
if ($this
->hasField('bcc_uid')) {
return $this
->get('bcc_uid')
->referencedEntities();
}
return NULL;
}
/**
* @inheritDoc
*/
public function setBCC($accounts) {
if ($this
->hasField('bcc_uid')) {
$this
->set('bcc_uid', $accounts);
}
return $this;
}
/**
* @inheritDoc
*/
public function getBCCIds() {
if ($this
->hasField('bcc_uid')) {
return $this
->getEntityReferenceIds($this
->get('bcc_uid'));
}
return [];
}
/**
* @inheritDoc
*/
public function setBCCIds($uids) {
if ($this
->hasField('bcc_uid')) {
$this
->set('bcc_uid', $uids);
}
return $this;
}
/**
* @inheritDoc
*/
public function addBCC($uid) {
if ($this
->hasField('bcc_uid')) {
return $this
->addEntityReferenceById($uid, 'bcc_uid');
}
return $this;
}
/**
* @inheritDoc
*/
public function removeBCC($uid) {
if ($this
->hasField('bcc_uid')) {
return $this
->removeEntityReferenceById($uid, 'bcc_uid');
}
return $this;
}
/**
* @inheritDoc
*/
public function getBCCAddresses() {
if ($this
->hasField('bcc_address')) {
return $this
->getListTextValues($this
->get('bcc_address'));
}
return NULL;
}
/**
* @inheritDoc
*/
public function setBCCAddresses($addresses) {
if ($this
->hasField('bcc_address')) {
$this
->set('bcc_address', $addresses);
}
return $this;
}
/**
* @inheritDoc
*/
public function addBCCAddress($address) {
if ($this
->hasField('bcc_address')) {
return $this
->addTextValueToList($address, 'bcc_address');
}
return $this;
}
/**
* @inheritDoc
*/
public function removeBCCAddress($address) {
if ($this
->hasField('bcc_address')) {
return $this
->removeTextValueFromList($address, 'bcc_address');
}
return $this;
}
/**
* @inheritDoc
*/
public function getFromName() {
if ($this
->hasField('from_name')) {
return $this
->get('from_name')->value;
}
return NULL;
}
/**
* @inheritDoc
*/
public function setFromName($from_name) {
if ($this
->hasField('from_name')) {
$this
->set('from_name', $from_name);
}
return $this;
}
/**
* @inheritDoc
*/
public function getFromAddress() {
if ($this
->hasField('from_address')) {
return $this
->get('from_address')->value;
}
return NULL;
}
/**
* @inheritDoc
*/
public function setFromAddress($from_email) {
if ($this
->hasField('from_address')) {
$this
->set('from_address', $from_email);
}
return $this;
}
/**
* @inheritDoc
*/
public function getReplyToAddress() {
if ($this
->hasField('reply_to')) {
return $this
->get('reply_to')->value;
}
return NULL;
}
/**
* @inheritDoc
*/
public function setReplyToAddress($reply_to_email) {
if ($this
->hasField('reply_to')) {
$this
->set('reply_to', $reply_to_email);
}
return $this;
}
/**
* @inheritDoc
*/
public function getSubject() {
return $this
->get('subject')->value;
}
/**
* @inheritDoc
*/
public function setSubject($subject) {
$this
->set('subject', $subject);
return $this;
}
/**
* @inheritDoc
*/
public function getInboxPreview() {
if ($this
->hasField('inbox_preview')) {
return $this
->get('inbox_preview')->value;
}
return NULL;
}
/**
* @inheritDoc
*/
public function setInboxPreview($text) {
if ($this
->hasField('inbox_preview')) {
$this
->set('inbox_preview', $text);
}
return $this;
}
/**
* @inheritDoc
*/
public function getHtmlBody() {
if ($this
->hasField('body_html')) {
return [
'value' => $this
->get('body_html')->value,
'format' => $this
->get('body_html')->format,
];
}
return NULL;
}
/**
* @inheritDoc
*/
public function setHtmlBody($text, $format) {
if ($this
->hasField('body_html')) {
$this
->set('body_html', [
'value' => $text,
'format' => $format,
]);
}
return $this;
}
/**
* @inheritDoc
*/
public function getPlainBody() {
if ($this
->hasField('body_plain')) {
return $this
->get('body_plain')->value;
}
return NULL;
}
/**
* @inheritDoc
*/
public function setPlainBody($text) {
if ($this
->hasField('body_plain')) {
$this
->set('body_plain', $text);
}
return $this;
}
/**
* @inheritDoc
*/
public function getAttachments() {
if ($this
->hasField('attachment')) {
return $this
->get('attachment')
->referencedEntities();
}
return [];
}
/**
* @inheritDoc
*/
public function setAttachments($files) {
if ($this
->hasField('attachment')) {
$this
->set('attachment', $files);
}
return $this;
}
/**
* @inheritDoc
*/
public function getAttachmentIds() {
if ($this
->hasField('attachment')) {
return $this
->getEntityReferenceIds($this
->get('attachment'));
}
return [];
}
/**
* @inheritDoc
*/
public function setAttachmentIds($fids) {
if ($this
->hasField('attachment')) {
$this
->set('attachment', $fids);
}
return $this;
}
/**
* @inheritDoc
*/
public function addAttachment($fid) {
if ($this
->hasField('attachment')) {
return $this
->addEntityReferenceById($fid, 'attachment');
}
return $this;
}
/**
* @inheritDoc
*/
public function removeAttachment($fid) {
if ($this
->hasField('attachment')) {
return $this
->removeEntityReferenceById($fid, 'attachment');
}
return $this;
}
/**
* @inheritDoc
*/
public function getAttachmentPaths() {
if ($this
->hasField('attachment_path')) {
return $this
->getListTextValues($this
->get('attachment_path'));
}
return NULL;
}
/**
* @inheritDoc
*/
public function setAttachmentPaths($paths) {
if ($this
->hasField('attachment_path')) {
$this
->set('attachment_path', $paths);
}
return $this;
}
/**
* @inheritDoc
*/
public function addAttachmentPath($path) {
if ($this
->hasField('attachment_path')) {
return $this
->addTextValueToList($path, 'attachment_path');
}
return NULL;
}
/**
* @inheritDoc
*/
public function removeAttachmentPath($path) {
if ($this
->hasField('attachment_path')) {
return $this
->removeTextValueFromList($path, 'attachment_path');
}
return $this;
}
/**
* @inheritDoc
*/
public function getEvaluatedAttachments() {
if (is_null($this->evaluatedAttachments)) {
$this->evaluatedAttachments = [];
}
return $this->evaluatedAttachments;
}
/**
* @inheritDoc
*/
public function setEvaluatedAttachments($attachments) {
$this->evaluatedAttachments = $attachments;
return $this;
}
/**
* @inheritDoc
*/
public function addEvaluatedAttachment($attachment) {
$existing_attachments = $this
->getEvaluatedAttachments();
foreach ($existing_attachments as $existing_attachment) {
if ($existing_attachment->uri === $attachment->uri) {
return $this;
}
}
$this->evaluatedAttachments[] = $attachment;
return $this;
}
/**
* @inheritDoc
*/
public function removeEvaluatedAttachment($attachment) {
$existing_attachments = $this
->getEvaluatedAttachments();
foreach ($existing_attachments as $i => $existing_attachment) {
if ($existing_attachment->uri === $attachment->uri) {
unset($existing_attachments[$i]);
}
}
$this->evaluatedAttachments = array_values($existing_attachments);
return $this;
}
/**
* {@inheritdoc}
*/
public function isSent() {
return (bool) $this
->get('sent')->value;
}
/**
* {@inheritdoc}
*/
public function getSentTime() {
return $this
->get('sent')->value;
}
/**
* {@inheritdoc}
*/
public function setSentTime($timestamp) {
$this
->set('sent', $timestamp);
return $this;
}
/**
* @param \Drupal\Core\Field\EntityReferenceFieldItemList $field_item_list
*
* @return int[]
* The entity IDs
*/
protected function getEntityReferenceIds($field_item_list) {
$ids = [];
if (!$field_item_list
->isEmpty()) {
foreach ($field_item_list as $delta => $item) {
if ($item->target_id !== NULL) {
$ids[$delta] = $item->target_id;
}
}
}
return $ids;
}
/**
* Add an entity by ID to the an entity reference field item list.
*
* @param int $id
* @param string $field_name
*
* @return $this
*/
protected function addEntityReferenceById($id, $field_name) {
$ids = $this
->getEntityReferenceIds($this
->get($field_name));
if (!is_null($ids) && !in_array($id, $ids)) {
$ids[] = $id;
$this
->set($field_name, $ids);
}
return $this;
}
/**
* Remove an entity by ID to the an entity reference field item list.
*
* @param int $id
* @param string $field_name
*
* @return $this
*/
protected function removeEntityReferenceById($id, $field_name) {
$ids = $this
->getEntityReferenceIds($this
->get($field_name));
if (!is_null($ids)) {
foreach ($ids as $delta => $value) {
if ($id === $value) {
unset($ids[$delta]);
}
}
$this
->set($field_name, $ids);
}
return $this;
}
/**
* @param \Drupal\Core\Field\FieldItemList $field_item_list
*
* @return string[]|null
* The string values from the field list
*/
protected function getListTextValues($field_item_list) {
if (!$field_item_list
->isEmpty()) {
$values = [];
foreach ($field_item_list as $delta => $item) {
if ($item->value !== NULL) {
$values[$delta] = $item->value;
}
}
return $values;
}
return NULL;
}
/**
* Add an entity by ID to the an entity reference field item list.
*
* @param string $text
* @param string $field_name
*
* @return $this
*/
protected function addTextValueToList($text, $field_name) {
$strings = $this
->getListTextValues($this
->get($field_name));
if (!is_null($strings) && !in_array($text, $strings)) {
$strings[] = $text;
$this
->set($field_name, $strings);
}
return $this;
}
/**
* Remove an entity by ID to the an entity reference field item list.
*
* @param string $text
* @param string $field_name
*
* @return $this
*/
protected function removeTextValueFromList($text, $field_name) {
$strings = $this
->getListTextValues($this
->get($field_name));
if (!is_null($strings)) {
foreach ($strings as $delta => $value) {
if ($text === $value) {
unset($strings[$delta]);
}
}
$this
->set($field_name, $strings);
}
return $this;
}
/**
* {@inheritdoc}
*/
public static function baseFieldDefinitions(EntityTypeInterface $entity_type) {
$fields = parent::baseFieldDefinitions($entity_type);
$fields['creator_uid'] = BaseFieldDefinition::create('entity_reference')
->setLabel(t('Creator'))
->setDescription(t('The user ID of creator of the Email entity.'))
->setRevisionable(TRUE)
->setSetting('target_type', 'user')
->setSetting('handler', 'default')
->setTranslatable(TRUE)
->setDisplayOptions('view', [
'label' => 'hidden',
'type' => 'author',
'weight' => 0,
])
->setDisplayOptions('form', [
'type' => 'entity_reference_autocomplete',
'weight' => 5,
'settings' => [
'match_operator' => 'CONTAINS',
'size' => '60',
'autocomplete_type' => 'tags',
'placeholder' => '',
],
])
->setDisplayConfigurable('form', TRUE)
->setDisplayConfigurable('view', TRUE);
$fields['recipient_address'] = BaseFieldDefinition::create('string')
->setLabel(t('Recipient Addresses'))
->setDescription(t('The recipient email addresses of the Email entity.'))
->setCardinality(BaseFieldDefinition::CARDINALITY_UNLIMITED)
->setRevisionable(TRUE)
->setSettings([
'max_length' => 255,
'text_processing' => 0,
])
->setDefaultValue('')
->setDisplayOptions('view', [
'label' => 'above',
'type' => 'string',
'weight' => -4,
])
->setDisplayOptions('form', [
'type' => 'string_textfield',
'weight' => -4,
])
->setDisplayConfigurable('form', TRUE)
->setDisplayConfigurable('view', TRUE);
$fields['subject'] = BaseFieldDefinition::create('string')
->setLabel(t('Subject'))
->setDescription(t('The Subject of the Email entity.'))
->setRevisionable(TRUE)
->setTranslatable(TRUE)
->setSettings([
'max_length' => 255,
'text_processing' => 0,
])
->setDefaultValue('')
->setDisplayOptions('view', [
'label' => 'above',
'type' => 'string',
'weight' => -4,
])
->setDisplayOptions('form', [
'type' => 'string_textfield',
'weight' => -4,
])
->setDisplayConfigurable('form', TRUE)
->setDisplayConfigurable('view', TRUE);
$fields['created'] = BaseFieldDefinition::create('created')
->setLabel(t('Created'))
->setDescription(t('The time that the entity was created.'));
$fields['changed'] = BaseFieldDefinition::create('changed')
->setLabel(t('Changed'))
->setDescription(t('The time that the entity was last edited.'));
$fields['sent'] = BaseFieldDefinition::create('timestamp')
->setLabel(t('Sent'))
->setDescription(t('The time that the entity was sent.'));
$fields['revision_translation_affected'] = BaseFieldDefinition::create('boolean')
->setLabel(t('Revision translation affected'))
->setDescription(t('Indicates if the last edit of a translation belongs to current revision.'))
->setReadOnly(TRUE)
->setRevisionable(TRUE)
->setTranslatable(TRUE);
return $fields;
}
}
Members
Name | Modifiers | Type | Description | Overrides |
---|---|---|---|---|
CacheableDependencyTrait:: |
protected | property | Cache contexts. | |
CacheableDependencyTrait:: |
protected | property | Cache max-age. | |
CacheableDependencyTrait:: |
protected | property | Cache tags. | |
CacheableDependencyTrait:: |
protected | function | Sets cacheability; useful for value object constructors. | |
ContentEntityBase:: |
protected | property | Language code identifying the entity active language. | |
ContentEntityBase:: |
protected | property | Local cache for the default language code. | |
ContentEntityBase:: |
protected | property | The default langcode entity key. | |
ContentEntityBase:: |
protected | property | Whether the revision translation affected flag has been enforced. | |
ContentEntityBase:: |
protected | property | Holds untranslatable entity keys such as the ID, bundle, and revision ID. | |
ContentEntityBase:: |
protected | property | Local cache for field definitions. | |
ContentEntityBase:: |
protected | property | The array of fields, each being an instance of FieldItemListInterface. | |
ContentEntityBase:: |
protected static | property | Local cache for fields to skip from the checking for translation changes. | |
ContentEntityBase:: |
protected | property | Indicates whether this is the default revision. | |
ContentEntityBase:: |
protected | property | The language entity key. | |
ContentEntityBase:: |
protected | property | Local cache for the available language objects. | |
ContentEntityBase:: |
protected | property | The loaded revision ID before the new revision was set. | |
ContentEntityBase:: |
protected | property | Boolean indicating whether a new revision should be created on save. | |
ContentEntityBase:: |
protected | property | The revision translation affected entity key. | |
ContentEntityBase:: |
protected | property | Holds translatable entity keys such as the label. | |
ContentEntityBase:: |
protected | property | A flag indicating whether a translation object is being initialized. | |
ContentEntityBase:: |
protected | property | An array of entity translation metadata. | |
ContentEntityBase:: |
protected | property | Whether entity validation was performed. | |
ContentEntityBase:: |
protected | property | Whether entity validation is required before saving the entity. | |
ContentEntityBase:: |
protected | property | The plain data values of the contained fields. | |
ContentEntityBase:: |
public | function |
Checks data value access. Overrides EntityBase:: |
1 |
ContentEntityBase:: |
public | function |
Adds a new translation to the translatable object. Overrides TranslatableInterface:: |
|
ContentEntityBase:: |
public | function |
Gets the bundle of the entity. Overrides EntityBase:: |
|
ContentEntityBase:: |
public static | function |
Provides field definitions for a specific bundle. Overrides FieldableEntityInterface:: |
4 |
ContentEntityBase:: |
protected | function | Clear entity translation object cache to remove stale references. | |
ContentEntityBase:: |
public | function |
Creates a duplicate of the entity. Overrides EntityBase:: |
1 |
ContentEntityBase:: |
public | function |
Gets a field item list. Overrides FieldableEntityInterface:: |
|
ContentEntityBase:: |
protected | function | Gets the value of the given entity key, if defined. | 1 |
ContentEntityBase:: |
public | function |
Gets the definition of a contained field. Overrides FieldableEntityInterface:: |
|
ContentEntityBase:: |
public | function |
Gets an array of field definitions of all contained fields. Overrides FieldableEntityInterface:: |
|
ContentEntityBase:: |
public | function |
Gets an array of all field item lists. Overrides FieldableEntityInterface:: |
|
ContentEntityBase:: |
protected | function | Returns an array of field names to skip in ::hasTranslationChanges. | 1 |
ContentEntityBase:: |
public | function | ||
ContentEntityBase:: |
protected | function | ||
ContentEntityBase:: |
public | function |
Gets the loaded Revision ID of the entity. Overrides RevisionableInterface:: |
|
ContentEntityBase:: |
public | function |
Gets the revision identifier of the entity. Overrides RevisionableInterface:: |
|
ContentEntityBase:: |
public | function |
Gets an array of field item lists for translatable fields. Overrides FieldableEntityInterface:: |
|
ContentEntityBase:: |
protected | function | Gets a translated field. | |
ContentEntityBase:: |
public | function |
Gets a translation of the data. Overrides TranslatableInterface:: |
|
ContentEntityBase:: |
public | function |
Returns the languages the data is translated to. Overrides TranslatableInterface:: |
|
ContentEntityBase:: |
public | function |
Returns the translation status. Overrides TranslationStatusInterface:: |
|
ContentEntityBase:: |
public | function |
Returns the translatable object referring to the original language. Overrides TranslatableInterface:: |
|
ContentEntityBase:: |
public | function |
Determines whether the entity has a field with the given name. Overrides FieldableEntityInterface:: |
|
ContentEntityBase:: |
public | function |
Checks there is a translation for the given language code. Overrides TranslatableInterface:: |
|
ContentEntityBase:: |
public | function |
Determines if the current translation of the entity has unsaved changes. Overrides TranslatableInterface:: |
|
ContentEntityBase:: |
public | function |
Gets the identifier. Overrides EntityBase:: |
|
ContentEntityBase:: |
protected | function | Instantiates a translation object for an existing translation. | |
ContentEntityBase:: |
public | function |
Checks if this entity is the default revision. Overrides RevisionableInterface:: |
|
ContentEntityBase:: |
public | function |
Checks whether the translation is the default one. Overrides TranslatableInterface:: |
|
ContentEntityBase:: |
public | function |
Checks if untranslatable fields should affect only the default translation. Overrides TranslatableRevisionableInterface:: |
|
ContentEntityBase:: |
public | function |
Checks if this entity is the latest revision. Overrides RevisionableInterface:: |
|
ContentEntityBase:: |
public | function |
Checks whether this is the latest revision affecting this translation. Overrides TranslatableRevisionableInterface:: |
|
ContentEntityBase:: |
public | function |
Determines whether a new revision should be created on save. Overrides RevisionableInterface:: |
|
ContentEntityBase:: |
public | function |
Checks whether the translation is new. Overrides TranslatableInterface:: |
|
ContentEntityBase:: |
public | function |
Checks whether the current translation is affected by the current revision. Overrides TranslatableRevisionableInterface:: |
|
ContentEntityBase:: |
public | function |
Checks if the revision translation affected flag value has been enforced. Overrides TranslatableRevisionableInterface:: |
|
ContentEntityBase:: |
public | function |
Returns the translation support status. Overrides TranslatableInterface:: |
|
ContentEntityBase:: |
public | function |
Checks whether entity validation is required before saving the entity. Overrides FieldableEntityInterface:: |
|
ContentEntityBase:: |
public | function |
Gets the label of the entity. Overrides EntityBase:: |
2 |
ContentEntityBase:: |
public | function |
Gets the language of the entity. Overrides EntityBase:: |
|
ContentEntityBase:: |
public | function |
Reacts to changes to a field. Overrides FieldableEntityInterface:: |
|
ContentEntityBase:: |
public | function |
Acts on a created entity before hooks are invoked. Overrides EntityBase:: |
|
ContentEntityBase:: |
public | function |
Acts on a saved entity before the insert or update hook is invoked. Overrides EntityBase:: |
5 |
ContentEntityBase:: |
public | function |
Acts on a revision before it gets saved. Overrides RevisionableInterface:: |
2 |
ContentEntityBase:: |
public | function |
Gets a list of entities referenced by this entity. Overrides EntityBase:: |
1 |
ContentEntityBase:: |
public | function |
Removes the translation identified by the given language code. Overrides TranslatableInterface:: |
|
ContentEntityBase:: |
public | function |
Sets a field value. Overrides FieldableEntityInterface:: |
|
ContentEntityBase:: |
protected | function | Populates the local cache for the default language code. | |
ContentEntityBase:: |
public | function |
Enforces an entity to be saved as a new revision. Overrides RevisionableInterface:: |
|
ContentEntityBase:: |
public | function |
Marks the current revision translation as affected. Overrides TranslatableRevisionableInterface:: |
|
ContentEntityBase:: |
public | function |
Enforces the revision translation affected flag value. Overrides TranslatableRevisionableInterface:: |
|
ContentEntityBase:: |
public | function |
Sets whether entity validation is required before saving the entity. Overrides FieldableEntityInterface:: |
|
ContentEntityBase:: |
public | function |
Gets an array of all property values. Overrides EntityBase:: |
|
ContentEntityBase:: |
protected | function | Updates language for already instantiated fields. | |
ContentEntityBase:: |
public | function |
Updates the loaded Revision ID with the revision ID. Overrides RevisionableInterface:: |
|
ContentEntityBase:: |
public | function | Updates the original values with the interim changes. | |
ContentEntityBase:: |
public | function |
Gets the entity UUID (Universally Unique Identifier). Overrides EntityBase:: |
|
ContentEntityBase:: |
public | function |
Validates the currently set values. Overrides FieldableEntityInterface:: |
|
ContentEntityBase:: |
public | function |
Checks whether the entity object was a default revision when it was saved. Overrides RevisionableInterface:: |
|
ContentEntityBase:: |
public | function | Magic method: Implements a deep clone. | |
ContentEntityBase:: |
public | function |
Constructs an Entity object. Overrides EntityBase:: |
|
ContentEntityBase:: |
public | function | Implements the magic method for getting object properties. | |
ContentEntityBase:: |
public | function | Implements the magic method for isset(). | |
ContentEntityBase:: |
public | function | Implements the magic method for setting object properties. | |
ContentEntityBase:: |
public | function |
Overrides EntityBase:: |
|
ContentEntityBase:: |
public | function | Implements the magic method for unset(). | |
DependencySerializationTrait:: |
protected | property | An array of entity type IDs keyed by the property name of their storages. | |
DependencySerializationTrait:: |
protected | property | An array of service IDs keyed by property name used for serialization. | |
DependencySerializationTrait:: |
public | function | Aliased as: traitSleep | 1 |
DependencySerializationTrait:: |
public | function | 2 | |
EasyEmail:: |
protected | property | ||
EasyEmail:: |
public | function |
@inheritDoc Overrides EasyEmailInterface:: |
|
EasyEmail:: |
public | function |
@inheritDoc Overrides EasyEmailInterface:: |
|
EasyEmail:: |
public | function |
@inheritDoc Overrides EasyEmailInterface:: |
|
EasyEmail:: |
public | function |
@inheritDoc Overrides EasyEmailInterface:: |
|
EasyEmail:: |
public | function |
@inheritDoc Overrides EasyEmailInterface:: |
|
EasyEmail:: |
public | function |
@inheritDoc Overrides EasyEmailInterface:: |
|
EasyEmail:: |
protected | function | Add an entity by ID to the an entity reference field item list. | |
EasyEmail:: |
public | function |
@inheritDoc Overrides EasyEmailInterface:: |
|
EasyEmail:: |
public | function |
@inheritDoc Overrides EasyEmailInterface:: |
|
EasyEmail:: |
public | function |
@inheritDoc Overrides EasyEmailInterface:: |
|
EasyEmail:: |
protected | function | Add an entity by ID to the an entity reference field item list. | |
EasyEmail:: |
public static | function |
Provides base field definitions for an entity type. Overrides RevisionableContentEntityBase:: |
|
EasyEmail:: |
public | function |
@inheritDoc Overrides EasyEmailInterface:: |
|
EasyEmail:: |
public | function |
@inheritDoc Overrides EasyEmailInterface:: |
|
EasyEmail:: |
public | function |
@inheritDoc Overrides EasyEmailInterface:: |
|
EasyEmail:: |
public | function |
@inheritDoc Overrides EasyEmailInterface:: |
|
EasyEmail:: |
public | function |
@inheritDoc Overrides EasyEmailInterface:: |
|
EasyEmail:: |
public | function |
@inheritDoc Overrides EasyEmailInterface:: |
|
EasyEmail:: |
public | function |
@inheritDoc Overrides EasyEmailInterface:: |
|
EasyEmail:: |
public | function |
@inheritDoc Overrides EasyEmailInterface:: |
|
EasyEmail:: |
public | function |
@inheritDoc Overrides EasyEmailInterface:: |
|
EasyEmail:: |
public | function |
Gets the Email creation timestamp. Overrides EasyEmailInterface:: |
|
EasyEmail:: |
public | function |
Returns the entity creator's user entity. Overrides EasyEmailInterface:: |
|
EasyEmail:: |
public | function |
Returns the entity creator's user ID. Overrides EasyEmailInterface:: |
|
EasyEmail:: |
protected | function | ||
EasyEmail:: |
public | function |
@inheritDoc Overrides EasyEmailInterface:: |
|
EasyEmail:: |
public | function |
@inheritDoc Overrides EasyEmailInterface:: |
|
EasyEmail:: |
public | function |
@inheritDoc Overrides EasyEmailInterface:: |
|
EasyEmail:: |
public | function |
@inheritDoc Overrides EasyEmailInterface:: |
|
EasyEmail:: |
public | function |
@inheritDoc Overrides EasyEmailInterface:: |
|
EasyEmail:: |
public | function |
@inheritDoc Overrides EasyEmailInterface:: |
|
EasyEmail:: |
protected | function | ||
EasyEmail:: |
public | function |
@inheritDoc Overrides EasyEmailInterface:: |
|
EasyEmail:: |
public | function |
@inheritDoc Overrides EasyEmailInterface:: |
|
EasyEmail:: |
public | function |
@inheritDoc Overrides EasyEmailInterface:: |
|
EasyEmail:: |
public | function |
@inheritDoc Overrides EasyEmailInterface:: |
|
EasyEmail:: |
public | function |
@inheritDoc Overrides EasyEmailInterface:: |
|
EasyEmail:: |
public | function |
Returns the Email sent timestamp. Overrides EasyEmailInterface:: |
|
EasyEmail:: |
public | function |
@inheritDoc Overrides EasyEmailInterface:: |
|
EasyEmail:: |
public | function |
Returns the Email sent status. Overrides EasyEmailInterface:: |
|
EasyEmail:: |
public static | function |
Changes the values of an entity before it is created. Overrides EntityBase:: |
|
EasyEmail:: |
public | function |
Acts on an entity before the presave hook is invoked. Overrides ContentEntityBase:: |
|
EasyEmail:: |
public | function |
@inheritDoc Overrides EasyEmailInterface:: |
|
EasyEmail:: |
public | function |
@inheritDoc Overrides EasyEmailInterface:: |
|
EasyEmail:: |
public | function |
@inheritDoc Overrides EasyEmailInterface:: |
|
EasyEmail:: |
public | function |
@inheritDoc Overrides EasyEmailInterface:: |
|
EasyEmail:: |
public | function |
@inheritDoc Overrides EasyEmailInterface:: |
|
EasyEmail:: |
public | function |
@inheritDoc Overrides EasyEmailInterface:: |
|
EasyEmail:: |
protected | function | Remove an entity by ID to the an entity reference field item list. | |
EasyEmail:: |
public | function |
@inheritDoc Overrides EasyEmailInterface:: |
|
EasyEmail:: |
public | function |
@inheritDoc Overrides EasyEmailInterface:: |
|
EasyEmail:: |
public | function |
@inheritDoc Overrides EasyEmailInterface:: |
|
EasyEmail:: |
protected | function | Remove an entity by ID to the an entity reference field item list. | |
EasyEmail:: |
public | function |
@inheritDoc Overrides EasyEmailInterface:: |
|
EasyEmail:: |
public | function |
@inheritDoc Overrides EasyEmailInterface:: |
|
EasyEmail:: |
public | function |
@inheritDoc Overrides EasyEmailInterface:: |
|
EasyEmail:: |
public | function |
@inheritDoc Overrides EasyEmailInterface:: |
|
EasyEmail:: |
public | function |
@inheritDoc Overrides EasyEmailInterface:: |
|
EasyEmail:: |
public | function |
@inheritDoc Overrides EasyEmailInterface:: |
|
EasyEmail:: |
public | function |
@inheritDoc Overrides EasyEmailInterface:: |
|
EasyEmail:: |
public | function |
@inheritDoc Overrides EasyEmailInterface:: |
|
EasyEmail:: |
public | function |
@inheritDoc Overrides EasyEmailInterface:: |
|
EasyEmail:: |
public | function |
Sets the Email creation timestamp. Overrides EasyEmailInterface:: |
|
EasyEmail:: |
public | function |
Sets the entity creator's user entity. Overrides EasyEmailInterface:: |
|
EasyEmail:: |
public | function |
Sets the entity creator's user ID. Overrides EasyEmailInterface:: |
|
EasyEmail:: |
public | function |
@inheritDoc Overrides EasyEmailInterface:: |
|
EasyEmail:: |
public | function |
@inheritDoc Overrides EasyEmailInterface:: |
|
EasyEmail:: |
public | function |
@inheritDoc Overrides EasyEmailInterface:: |
|
EasyEmail:: |
public | function |
@inheritDoc Overrides EasyEmailInterface:: |
|
EasyEmail:: |
public | function |
@inheritDoc Overrides EasyEmailInterface:: |
|
EasyEmail:: |
public | function |
@inheritDoc Overrides EasyEmailInterface:: |
|
EasyEmail:: |
public | function |
@inheritDoc Overrides EasyEmailInterface:: |
|
EasyEmail:: |
public | function |
@inheritDoc Overrides EasyEmailInterface:: |
|
EasyEmail:: |
public | function |
@inheritDoc Overrides EasyEmailInterface:: |
|
EasyEmail:: |
public | function |
@inheritDoc Overrides EasyEmailInterface:: |
|
EasyEmail:: |
public | function |
@inheritDoc Overrides EasyEmailInterface:: |
|
EasyEmail:: |
public | function |
Sets the sent timestamp of a Email. Overrides EasyEmailInterface:: |
|
EasyEmail:: |
public | function |
@inheritDoc Overrides EasyEmailInterface:: |
|
EasyEmail:: |
protected | function |
Gets an array of placeholders for this entity. Overrides EntityBase:: |
|
EntityBase:: |
protected | property | Boolean indicating whether the entity should be forced to be new. | |
EntityBase:: |
protected | property | The entity type. | |
EntityBase:: |
protected | property | A typed data object wrapping this entity. | |
EntityBase:: |
public static | function |
Constructs a new entity object, without permanently saving it. Overrides EntityInterface:: |
|
EntityBase:: |
public | function |
Deletes an entity permanently. Overrides EntityInterface:: |
2 |
EntityBase:: |
public | function |
Enforces an entity to be new. Overrides EntityInterface:: |
|
EntityBase:: |
protected | function | Gets the entity manager. | |
EntityBase:: |
protected | function | Gets the entity type bundle info service. | |
EntityBase:: |
protected | function | Gets the entity type manager. | |
EntityBase:: |
public | function |
The cache contexts associated with this object. Overrides CacheableDependencyTrait:: |
|
EntityBase:: |
public | function |
The maximum age for which this object may be cached. Overrides CacheableDependencyTrait:: |
|
EntityBase:: |
public | function |
The cache tags associated with this object. Overrides CacheableDependencyTrait:: |
|
EntityBase:: |
public | function |
Returns the cache tags that should be used to invalidate caches. Overrides EntityInterface:: |
2 |
EntityBase:: |
public | function |
Gets the key that is used to store configuration dependencies. Overrides EntityInterface:: |
|
EntityBase:: |
public | function |
Gets the configuration dependency name. Overrides EntityInterface:: |
1 |
EntityBase:: |
public | function |
Gets the configuration target identifier for the entity. Overrides EntityInterface:: |
1 |
EntityBase:: |
public | function |
Gets the entity type definition. Overrides EntityInterface:: |
|
EntityBase:: |
public | function |
Gets the ID of the type of the entity. Overrides EntityInterface:: |
|
EntityBase:: |
protected | function | The list cache tags to invalidate for this entity. | |
EntityBase:: |
public | function |
Gets the original ID. Overrides EntityInterface:: |
1 |
EntityBase:: |
public | function |
Gets a typed data object for this entity object. Overrides EntityInterface:: |
|
EntityBase:: |
public | function |
Indicates if a link template exists for a given key. Overrides EntityInterface:: |
|
EntityBase:: |
protected static | function | Invalidates an entity's cache tags upon delete. | 1 |
EntityBase:: |
protected | function | Invalidates an entity's cache tags upon save. | 1 |
EntityBase:: |
public | function |
Determines whether the entity is new. Overrides EntityInterface:: |
2 |
EntityBase:: |
protected | function | Gets the language manager. | |
EntityBase:: |
public | function |
Deprecated way of generating a link to the entity. See toLink(). Overrides EntityInterface:: |
1 |
EntityBase:: |
protected | function | Gets an array link templates. | 1 |
EntityBase:: |
public static | function |
Loads an entity. Overrides EntityInterface:: |
|
EntityBase:: |
public static | function |
Loads one or more entities. Overrides EntityInterface:: |
|
EntityBase:: |
public static | function |
Acts on deleted entities before the delete hook is invoked. Overrides EntityInterface:: |
16 |
EntityBase:: |
public static | function |
Acts on loaded entities. Overrides EntityInterface:: |
2 |
EntityBase:: |
public static | function |
Acts on entities before they are deleted and before hooks are invoked. Overrides EntityInterface:: |
4 |
EntityBase:: |
public | function |
Saves an entity permanently. Overrides EntityInterface:: |
3 |
EntityBase:: |
public | function |
Sets the original ID. Overrides EntityInterface:: |
1 |
EntityBase:: |
public | function |
Generates the HTML for a link to this entity. Overrides EntityInterface:: |
|
EntityBase:: |
public | function |
Gets the URL object for the entity. Overrides EntityInterface:: |
2 |
EntityBase:: |
public | function |
Gets a list of URI relationships supported by this entity. Overrides EntityInterface:: |
|
EntityBase:: |
public | function |
Gets the public URL for this entity. Overrides EntityInterface:: |
2 |
EntityBase:: |
public | function |
Gets the URL object for the entity. Overrides EntityInterface:: |
1 |
EntityBase:: |
protected | function | Gets the UUID generator. | |
EntityChangedTrait:: |
public | function | Gets the timestamp of the last entity change for the current translation. | |
EntityChangedTrait:: |
public | function | Returns the timestamp of the last entity change across all translations. | |
EntityChangedTrait:: |
public | function | Sets the timestamp of the last entity change for the current translation. | |
EntityChangesDetectionTrait:: |
protected | function | Returns an array of field names to skip when checking for changes. Aliased as: traitGetFieldsToSkipFromTranslationChangesCheck | |
RefinableCacheableDependencyTrait:: |
public | function | 1 | |
RefinableCacheableDependencyTrait:: |
public | function | ||
RefinableCacheableDependencyTrait:: |
public | function | ||
RefinableCacheableDependencyTrait:: |
public | function | ||
RevisionLogEntityTrait:: |
public | function | Implements \Drupal\Core\Entity\RevisionLogInterface::getRevisionCreationTime(). | 1 |
RevisionLogEntityTrait:: |
public | function | Implements \Drupal\Core\Entity\RevisionLogInterface::getRevisionLogMessage(). | 1 |
RevisionLogEntityTrait:: |
protected static | function | Gets the name of a revision metadata field. | |
RevisionLogEntityTrait:: |
public | function | Implements \Drupal\Core\Entity\RevisionLogInterface::getRevisionUser(). | 1 |
RevisionLogEntityTrait:: |
public | function | Implements \Drupal\Core\Entity\RevisionLogInterface::getRevisionUserId(). | 1 |
RevisionLogEntityTrait:: |
public static | function | Provides revision-related base field definitions for an entity type. | |
RevisionLogEntityTrait:: |
public | function | Implements \Drupal\Core\Entity\RevisionLogInterface::setRevisionCreationTime(). | 1 |
RevisionLogEntityTrait:: |
public | function | Implements \Drupal\Core\Entity\RevisionLogInterface::setRevisionLogMessage(). | 1 |
RevisionLogEntityTrait:: |
public | function | Implements \Drupal\Core\Entity\RevisionLogInterface::setRevisionUser(). | 1 |
RevisionLogEntityTrait:: |
public | function | Implements \Drupal\Core\Entity\RevisionLogInterface::setRevisionUserId(). | 1 |
SynchronizableEntityTrait:: |
protected | property | Whether this entity is being created, updated or deleted through a synchronization process. | |
SynchronizableEntityTrait:: |
public | function | ||
SynchronizableEntityTrait:: |
public | function | ||
TranslationStatusInterface:: |
constant | Status code identifying a newly created translation. | ||
TranslationStatusInterface:: |
constant | Status code identifying an existing translation. | ||
TranslationStatusInterface:: |
constant | Status code identifying a removed translation. |