class Wishlist in Commerce Wishlist 8.3
Defines the wishlist entity class.
Plugin annotation
@ContentEntityType(
id = "commerce_wishlist",
label = @Translation("Wishlist"),
label_collection = @Translation("Wishlists"),
label_singular = @Translation("wishlist"),
label_plural = @Translation("wishlists"),
label_count = @PluralTranslation(
singular = "@count wishlist",
plural = "@count wishlists",
),
bundle_label = @Translation("Wishlist type"),
handlers = {
"event" = "Drupal\commerce_wishlist\Event\WishlistEvent",
"storage" = "Drupal\commerce_wishlist\WishlistStorage",
"access" = "Drupal\entity\UncacheableEntityAccessControlHandler",
"query_access" = "Drupal\entity\QueryAccess\UncacheableQueryAccessHandler",
"permission_provider" = "Drupal\entity\UncacheableEntityPermissionProvider",
"list_builder" = "Drupal\commerce_wishlist\WishlistListBuilder",
"views_data" = "Drupal\commerce\CommerceEntityViewsData",
"form" = {
"default" = "Drupal\commerce_wishlist\Form\WishlistForm",
"add" = "Drupal\commerce_wishlist\Form\WishlistForm",
"edit" = "Drupal\commerce_wishlist\Form\WishlistForm",
"duplicate" = "Drupal\commerce_wishlist\Form\WishlistForm",
"delete" = "Drupal\Core\Entity\ContentEntityDeleteForm",
"user" = "Drupal\commerce_wishlist\Form\WishlistUserForm",
"share" = "Drupal\commerce_wishlist\Form\WishlistShareForm",
},
"local_task_provider" = {
"default" = "Drupal\entity\Menu\DefaultEntityLocalTaskProvider",
},
"route_provider" = {
"default" = "Drupal\commerce_wishlist\WishlistRouteProvider",
"delete-multiple" = "Drupal\entity\Routing\DeleteMultipleRouteProvider",
},
},
base_table = "commerce_wishlist",
admin_permission = "administer commerce_wishlist",
permission_granularity = "bundle",
fieldable = TRUE,
entity_keys = {
"id" = "wishlist_id",
"label" = "name",
"uuid" = "uuid",
"bundle" = "type",
"uid" = "uid",
"owner" = "uid",
},
links = {
"add-page" = "/admin/commerce/wishlists/add",
"add-form" = "/admin/commerce/wishlists/add/{commerce_wishlist_type}",
"edit-form" = "/admin/commerce/wishlists/{commerce_wishlist}/edit",
"duplicate-form" = "/admin/commerce/wishlists/{commerce_wishlist}/duplicate",
"delete-form" = "/admin/commerce/wishlists/{commerce_wishlist}/delete",
"delete-multiple-form" = "/admin/commerce/wishlists/delete",
"collection" = "/admin/commerce/wishlists",
"user-form" = "/user/{user}/wishlist/{code}",
"share-form" = "/user/{user}/wishlist/{code}/share",
},
bundle_entity_type = "commerce_wishlist_type",
field_ui_base_route = "entity.commerce_wishlist_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\commerce_wishlist\Entity\Wishlist implements WishlistInterface uses EntityChangedTrait, EntityOwnerTrait
- class \Drupal\Core\Entity\ContentEntityBase implements \Drupal\Core\Entity\IteratorAggregate, ContentEntityInterface, TranslationStatusInterface uses EntityChangesDetectionTrait, SynchronizableEntityTrait
Expanded class hierarchy of Wishlist
9 files declare their use of Wishlist
- WishlistAnonymousTest.php in tests/
src/ FunctionalJavascript/ WishlistAnonymousTest.php - WishlistAssignmentTest.php in tests/
src/ Kernel/ WishlistAssignmentTest.php - WishlistItemAccessTest.php in tests/
src/ Kernel/ WishlistItemAccessTest.php - WishlistItemDeleteTest.php in tests/
src/ Kernel/ QueueWorker/ WishlistItemDeleteTest.php - WishlistItemTest.php in tests/
src/ Kernel/ Entity/ WishlistItemTest.php
4 string references to 'Wishlist'
- commerce_wishlist.links.task.yml in ./
commerce_wishlist.links.task.yml - commerce_wishlist.links.task.yml
- commerce_wishlist.routing.yml in ./
commerce_wishlist.routing.yml - commerce_wishlist.routing.yml
- core.entity_view_mode.commerce_product_variation.wishlist.yml in config/
optional/ core.entity_view_mode.commerce_product_variation.wishlist.yml - config/optional/core.entity_view_mode.commerce_product_variation.wishlist.yml
- WishlistProvider::createWishlist in src/
WishlistProvider.php - Creates a wishlist entity for the given user.
File
- src/
Entity/ Wishlist.php, line 81
Namespace
Drupal\commerce_wishlist\EntityView source
class Wishlist extends ContentEntityBase implements WishlistInterface {
use EntityChangedTrait;
use EntityOwnerTrait;
/**
* {@inheritdoc}
*/
public function createDuplicate() {
$duplicate = parent::createDuplicate();
// Unique code cannot be transferred because their codes are unique.
$duplicate
->set('code', NULL);
// We don't duplicate wishlist items.
$duplicate
->set('wishlist_items', []);
return $duplicate;
}
/**
* {@inheritdoc}
*/
public function toUrl($rel = 'canonical', array $options = []) {
// Can't declare "canonical" as a link template because it requires a
// custom parameter, which breaks contribs that don't expect it.
// StringFormatter assumes 'revision' is always a valid link template.
if (in_array($rel, [
'canonical',
'revision',
])) {
$route_name = 'entity.commerce_wishlist.canonical';
$route_parameters = [
'code' => $this
->getCode(),
];
$options += [
'entity_type' => 'commerce_wishlist',
'entity' => $this,
// Display links by default based on the current language.
'language' => $this
->language(),
];
return new Url($route_name, $route_parameters, $options);
}
else {
return parent::toUrl($rel, $options);
}
}
/**
* {@inheritdoc}
*/
protected function urlRouteParameters($rel) {
if (in_array($rel, [
'user-form',
'share-form',
])) {
return [
'user' => $this
->getOwnerId(),
'code' => $this
->getCode(),
];
}
else {
return parent::urlRouteParameters($rel);
}
}
/**
* {@inheritdoc}
*/
public function getCode() {
return $this
->get('code')->value;
}
/**
* {@inheritdoc}
*/
public function setCode($code) {
$this
->set('code', $code);
return $this;
}
/**
* {@inheritdoc}
*/
public function getName() {
return $this
->get('name')->value;
}
/**
* {@inheritdoc}
*/
public function setName($name) {
$this
->set('name', $name);
return $this;
}
/**
* {@inheritdoc}
*/
public function getShippingProfile() {
return $this
->get('shipping_profile')->entity;
}
/**
* {@inheritdoc}
*/
public function setShippingProfile(ProfileInterface $profile) {
$this
->set('shipping_profile', $profile);
return $this;
}
/**
* {@inheritdoc}
*/
public function getItems() {
return $this
->get('wishlist_items')
->referencedEntities();
}
/**
* {@inheritdoc}
*/
public function setItems(array $wishlist_items) {
$this
->set('wishlist_items', $wishlist_items);
return $this;
}
/**
* {@inheritdoc}
*/
public function hasItems() {
return !$this
->get('wishlist_items')
->isEmpty();
}
/**
* {@inheritdoc}
*/
public function addItem(WishlistItemInterface $wishlist_item) {
if (!$this
->hasItem($wishlist_item)) {
$this
->get('wishlist_items')
->appendItem($wishlist_item);
}
return $this;
}
/**
* {@inheritdoc}
*/
public function removeItem(WishlistItemInterface $wishlist_item) {
$index = $this
->getItemIndex($wishlist_item);
if ($index !== FALSE) {
$this
->get('wishlist_items')
->offsetUnset($index);
}
return $this;
}
/**
* {@inheritdoc}
*/
public function hasItem(WishlistItemInterface $wishlist_item) {
return $this
->getItemIndex($wishlist_item) !== FALSE;
}
/**
* Gets the index of the given wishlist item.
*
* @param \Drupal\commerce_wishlist\Entity\WishlistItemInterface $wishlist_item
* The wishlist item.
*
* @return int|bool
* The index of the given wishlist item, or FALSE if not found.
*/
protected function getItemIndex(WishlistItemInterface $wishlist_item) {
$values = $this
->get('wishlist_items')
->getValue();
$wishlist_item_ids = array_map(function ($value) {
return $value['target_id'];
}, $values);
return array_search($wishlist_item
->id(), $wishlist_item_ids);
}
/**
* {@inheritdoc}
*/
public function isDefault() {
return (bool) $this
->get('is_default')->value;
}
/**
* {@inheritdoc}
*/
public function setDefault($default) {
$this
->set('is_default', (bool) $default);
return $this;
}
/**
* {@inheritdoc}
*/
public function isPublic() {
return (bool) $this
->get('is_public')->value;
}
/**
* {@inheritdoc}
*/
public function setPublic($public) {
$this
->set('is_public', (bool) $public);
return $this;
}
/**
* {@inheritdoc}
*/
public function getKeepPurchasedItems() {
return (bool) $this
->get('keep_purchased_items')->value;
}
/**
* {@inheritdoc}
*/
public function setKeepPurchasedItems($keep_purchased_items) {
$this
->set('keep_purchased_items', (bool) $keep_purchased_items);
return $this;
}
/**
* {@inheritdoc}
*/
public function getCreatedTime() {
return $this
->get('created')->value;
}
/**
* {@inheritdoc}
*/
public function setCreatedTime($timestamp) {
$this
->set('created', $timestamp);
return $this;
}
/**
* {@inheritdoc}
*/
public function preSave(EntityStorageInterface $storage) {
/** @var \Drupal\commerce_wishlist\WishlistStorageInterface $storage */
parent::preSave($storage);
if ($this
->get('code')
->isEmpty()) {
/** @var \Drupal\commerce_wishlist\WishlistStorageInterface $storage */
$storage = $this
->entityTypeManager()
->getStorage('commerce_wishlist');
$random = new Random();
$code = $random
->word(13);
// Ensure code uniqueness. Collisions are rare, but possible.
while ($storage
->loadByCode($code)) {
$code = $random
->word(13);
}
$this
->setCode($random
->word(13));
}
// Mark the wishlist as default if there's no other default.
if ($this
->getOwnerId() && !$this
->isDefault()) {
$wishlist = $storage
->loadDefaultByUser($this
->getOwner(), $this
->bundle());
if (!$wishlist || !$wishlist
->isDefault()) {
$this
->setDefault(TRUE);
}
}
}
/**
* {@inheritdoc}
*/
public function postSave(EntityStorageInterface $storage, $update = TRUE) {
/** @var \Drupal\commerce_wishlist\WishlistStorageInterface $storage */
parent::postSave($storage, $update);
// Ensure there's a back-reference on each wishlist item.
foreach ($this
->getItems() as $wishlist_item) {
if ($wishlist_item->wishlist_id
->isEmpty()) {
$wishlist_item->wishlist_id = $this
->id();
$wishlist_item
->save();
}
}
if ($this
->getOwnerId()) {
$default = $this
->isDefault();
$original_default = $this->original ? $this->original
->isDefault() : FALSE;
if ($default && !$original_default) {
$wishlists = $storage
->loadMultipleByUser($this
->getOwner(), $this
->bundle());
foreach ($wishlists as $wishlist) {
if ($wishlist
->id() != $this
->id() && $wishlist
->isDefault()) {
$wishlist
->setDefault(FALSE);
$wishlist
->save();
}
}
}
}
}
/**
* {@inheritdoc}
*/
public static function postDelete(EntityStorageInterface $storage, array $entities) {
parent::postDelete($storage, $entities);
// Delete the wishlist items of a deleted wishlist.
$wishlist_items = [];
/** @var \Drupal\commerce_wishlist\Entity\WishlistInterface $entity */
foreach ($entities as $entity) {
foreach ($entity
->getItems() as $wishlist_item) {
$wishlist_items[$wishlist_item
->id()] = $wishlist_item;
}
}
/** @var \Drupal\commerce_wishlist\WishlistItemStorageInterface $wishlist_item_storage */
$wishlist_item_storage = \Drupal::service('entity_type.manager')
->getStorage('commerce_wishlist_item');
$wishlist_item_storage
->delete($wishlist_items);
}
/**
* {@inheritdoc}
*/
public static function baseFieldDefinitions(EntityTypeInterface $entity_type) {
$fields = parent::baseFieldDefinitions($entity_type);
$fields += static::ownerBaseFieldDefinitions($entity_type);
$fields['code'] = BaseFieldDefinition::create('string')
->setLabel(t('Code'))
->setDescription(t('The wishlist code.'))
->setSetting('max_length', 25)
->addConstraint('UniqueField', []);
$fields['name'] = BaseFieldDefinition::create('string')
->setLabel(t('Name'))
->setDescription(t('The wishlist name.'))
->setRequired(TRUE)
->setDefaultValue('')
->setSetting('max_length', 255)
->setDisplayConfigurable('form', TRUE)
->setDisplayConfigurable('view', TRUE);
$fields['uid']
->setLabel(t('Owner'))
->setDescription(t('The wishlist owner.'))
->setSetting('handler', 'default')
->setDisplayOptions('view', [
'label' => 'above',
'type' => 'author',
'weight' => 0,
])
->setDisplayConfigurable('form', TRUE)
->setDisplayConfigurable('view', TRUE);
$fields['shipping_profile'] = BaseFieldDefinition::create('entity_reference_revisions')
->setLabel(t('Shipping profile'))
->setDescription(t('Shipping profile'))
->setSetting('target_type', 'profile')
->setSetting('handler', 'default')
->setSetting('handler_settings', [
'target_bundles' => [
'customer',
],
])
->setDisplayOptions('form', [
'type' => 'options_select',
'weight' => 0,
'settings' => [],
])
->setDisplayConfigurable('form', TRUE)
->setDisplayConfigurable('view', TRUE);
$fields['wishlist_items'] = BaseFieldDefinition::create('entity_reference')
->setLabel(t('Wishlist items'))
->setDescription(t('The wishlist items.'))
->setCardinality(BaseFieldDefinition::CARDINALITY_UNLIMITED)
->setSetting('target_type', 'commerce_wishlist_item')
->setSetting('handler', 'default')
->setDisplayOptions('view', [
'type' => 'commerce_wishlist_item_table',
'weight' => 0,
])
->setDisplayConfigurable('form', FALSE)
->setDisplayConfigurable('view', TRUE);
$fields['is_default'] = BaseFieldDefinition::create('boolean')
->setLabel(t('Default'))
->setDescription(t('A boolean indicating whether the wishlist is the default one.'));
$fields['is_public'] = BaseFieldDefinition::create('boolean')
->setLabel(t('Public'))
->setDescription(t('Whether the wishlist is public.'))
->setDisplayOptions('form', [
'type' => 'boolean_checkbox',
'settings' => [
'display_label' => TRUE,
],
'weight' => 19,
])
->setDisplayConfigurable('form', TRUE);
$fields['keep_purchased_items'] = BaseFieldDefinition::create('boolean')
->setLabel(t('Keep purchased items in the list'))
->setDescription(t('Whether items should remain in the wishlist once purchased.'))
->setDefaultValue(TRUE)
->setDisplayOptions('form', [
'type' => 'boolean_checkbox',
'settings' => [
'display_label' => TRUE,
],
'weight' => 20,
])
->setDisplayConfigurable('form', TRUE);
$fields['created'] = BaseFieldDefinition::create('created')
->setLabel(t('Created'))
->setDescription(t('The time when the wishlist was created.'));
$fields['changed'] = BaseFieldDefinition::create('changed')
->setLabel(t('Changed'))
->setDescription(t('The time when the wishlist was last edited.'));
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 |
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 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 | |
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 loaded entities. Overrides EntityInterface:: |
2 |
EntityBase:: |
public static | function |
Changes the values of an entity before it is created. Overrides EntityInterface:: |
5 |
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 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 | |
EntityOwnerTrait:: |
public static | function | Default value callback for 'owner' base field. | 1 |
EntityOwnerTrait:: |
public | function | 1 | |
EntityOwnerTrait:: |
public | function | ||
EntityOwnerTrait:: |
public static | function | Returns an array of base field definitions for entity owners. | |
EntityOwnerTrait:: |
public | function | ||
EntityOwnerTrait:: |
public | function | ||
RefinableCacheableDependencyTrait:: |
public | function | 1 | |
RefinableCacheableDependencyTrait:: |
public | function | ||
RefinableCacheableDependencyTrait:: |
public | function | ||
RefinableCacheableDependencyTrait:: |
public | function | ||
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. | ||
Wishlist:: |
public | function |
Adds an wishlist item. Overrides WishlistInterface:: |
|
Wishlist:: |
public static | function |
Provides base field definitions for an entity type. Overrides ContentEntityBase:: |
|
Wishlist:: |
public | function |
Creates a duplicate of the entity. Overrides ContentEntityBase:: |
|
Wishlist:: |
public | function |
Gets the wishlist code. Overrides WishlistInterface:: |
|
Wishlist:: |
public | function |
Gets the wishlist creation timestamp. Overrides WishlistInterface:: |
|
Wishlist:: |
protected | function | Gets the index of the given wishlist item. | |
Wishlist:: |
public | function |
Gets the wishlist items. Overrides WishlistInterface:: |
|
Wishlist:: |
public | function |
Gets whether items should remain in the wishlist once purchased. Overrides WishlistInterface:: |
|
Wishlist:: |
public | function |
Gets the wishlist name. Overrides WishlistInterface:: |
|
Wishlist:: |
public | function |
Gets the shipping profile. Overrides WishlistInterface:: |
|
Wishlist:: |
public | function |
Checks whether the wishlist has a given wishlist item. Overrides WishlistInterface:: |
|
Wishlist:: |
public | function |
Gets whether the wishlist has wishlist items. Overrides WishlistInterface:: |
|
Wishlist:: |
public | function |
Gets whether this is the user's default wishlist. Overrides WishlistInterface:: |
|
Wishlist:: |
public | function |
Gets whether the wishlist is public. Overrides WishlistInterface:: |
|
Wishlist:: |
public static | function |
Acts on deleted entities before the delete hook is invoked. Overrides EntityBase:: |
|
Wishlist:: |
public | function |
Acts on a saved entity before the insert or update hook is invoked. Overrides ContentEntityBase:: |
|
Wishlist:: |
public | function |
Acts on an entity before the presave hook is invoked. Overrides ContentEntityBase:: |
|
Wishlist:: |
public | function |
Removes an wishlist item. Overrides WishlistInterface:: |
|
Wishlist:: |
public | function |
Sets the wishlist code. Overrides WishlistInterface:: |
|
Wishlist:: |
public | function |
Sets the wishlist creation timestamp. Overrides WishlistInterface:: |
|
Wishlist:: |
public | function |
Sets whether this is the user's default wishlist. Overrides WishlistInterface:: |
|
Wishlist:: |
public | function |
Sets the wishlist items. Overrides WishlistInterface:: |
|
Wishlist:: |
public | function |
Sets whether items should remain in the wishlist once purchased. Overrides WishlistInterface:: |
|
Wishlist:: |
public | function |
Sets the wishlist name. Overrides WishlistInterface:: |
|
Wishlist:: |
public | function |
Sets whether the wishlist is public. Overrides WishlistInterface:: |
|
Wishlist:: |
public | function |
Sets the shipping profile. Overrides WishlistInterface:: |
|
Wishlist:: |
public | function |
Gets the URL object for the entity. Overrides EntityBase:: |
|
Wishlist:: |
protected | function |
Gets an array of placeholders for this entity. Overrides EntityBase:: |