class Feed in Feeds 8.3
Same name in this branch
- 8.3 src/Utility/Feed.php \Drupal\feeds\Utility\Feed
- 8.3 src/Entity/Feed.php \Drupal\feeds\Entity\Feed
Defines the feed entity class.
Plugin annotation
@ContentEntityType(
id = "feeds_feed",
label = @Translation("Feed"),
bundle_label = @Translation("Feed type"),
module = "feeds",
handlers = {
"storage" = "Drupal\feeds\FeedStorage",
"view_builder" = "Drupal\feeds\FeedViewBuilder",
"access" = "Drupal\feeds\FeedAccessControlHandler",
"views_data" = "Drupal\feeds\FeedViewsData",
"form" = {
"default" = "Drupal\feeds\FeedForm",
"update" = "Drupal\feeds\FeedForm",
"delete" = "Drupal\feeds\Form\FeedDeleteForm",
"import" = "Drupal\feeds\Form\FeedImportForm",
"schedule_import" = "Drupal\feeds\Form\FeedScheduleImportForm",
"clear" = "Drupal\feeds\Form\FeedClearForm",
"unlock" = "Drupal\feeds\Form\FeedUnlockForm",
},
"list_builder" = "Drupal\feeds\FeedListBuilder",
"route_provider" = {
"html" = "Drupal\Core\Entity\Routing\AdminHtmlRouteProvider",
},
"feed_import" = "Drupal\feeds\FeedImportHandler",
"feed_clear" = "Drupal\feeds\FeedClearHandler",
"feed_expire" = "Drupal\feeds\FeedExpireHandler"
},
base_table = "feeds_feed",
fieldable = TRUE,
entity_keys = {
"id" = "fid",
"bundle" = "type",
"label" = "title",
"uuid" = "uuid"
},
permission_granularity = "bundle",
bundle_entity_type = "feeds_feed_type",
field_ui_base_route = "entity.feeds_feed_type.edit_form",
links = {
"canonical" = "/feed/{feeds_feed}",
"add-page" = "/feed/add",
"add-form" = "/feed/add/{feeds_feed_type}",
"delete-form" = "/feed/{feeds_feed}/delete",
"edit-form" = "/feed/{feeds_feed}/edit",
"import-form" = "/feed/{feeds_feed}/import",
"schedule-import-form" = "/feed/{feeds_feed}/schedule-import",
"clear-form" = "/feed/{feeds_feed}/delete-items"
}
)
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\feeds\Entity\Feed implements FeedInterface uses EntityChangedTrait
- class \Drupal\Core\Entity\ContentEntityBase implements \Drupal\Core\Entity\IteratorAggregate, ContentEntityInterface, TranslationStatusInterface uses EntityChangesDetectionTrait, SynchronizableEntityTrait
Expanded class hierarchy of Feed
7 files declare their use of Feed
- CsvParserFeedFormTest.php in tests/
src/ Functional/ Feeds/ Parser/ Form/ CsvParserFeedFormTest.php - CsvParserTest.php in tests/
src/ FunctionalJavascript/ Feeds/ Parser/ CsvParserTest.php - DeleteFeedTest.php in tests/
src/ Functional/ Plugin/ Action/ DeleteFeedTest.php - FeedCreationTrait.php in tests/
src/ Traits/ FeedCreationTrait.php - feeds.module in ./
feeds.module - Feeds hook implementations.
File
- src/
Entity/ Feed.php, line 81
Namespace
Drupal\feeds\EntityView source
class Feed extends ContentEntityBase implements FeedInterface {
use EntityChangedTrait;
/**
* An array of import stage states keyed by state.
*
* @var array
*/
protected $states;
/**
* Implements the magic __wakeup function to reset states.
*/
public function __wakeup() {
$this->states = [];
}
/**
* Gets the event dispatcher.
*
* @return \Symfony\Component\EventDispatcher\EventDispatcherInterface
* The event dispatcher service.
*/
protected function eventDispatcher() {
return \Drupal::service('event_dispatcher');
}
/**
* {@inheritdoc}
*/
public function id() {
return $this
->get('fid')->value;
}
/**
* {@inheritdoc}
*/
public function label() {
return $this
->get('title')->value;
}
/**
* {@inheritdoc}
*/
public function getSource() {
return $this
->get('source')->value;
}
/**
* {@inheritdoc}
*/
public function setSource($source) {
return $this
->set('source', $source);
}
/**
* {@inheritdoc}
*/
public function getCreatedTime() {
return (int) $this
->get('created')->value;
}
/**
* {@inheritdoc}
*/
public function setCreatedTime($timestamp) {
$this
->set('created', (int) $timestamp);
}
/**
* {@inheritdoc}
*/
public function getChangedTime() {
return (int) $this
->get('changed')->value;
}
/**
* {@inheritdoc}
*/
public function getImportedTime() {
return (int) $this
->get('imported')->value;
}
/**
* {@inheritdoc}
*/
public function getNextImportTime() {
return (int) $this
->get('next')->value;
}
/**
* {@inheritdoc}
*/
public function getQueuedTime() {
return (int) $this
->get('queued')->value;
}
/**
* {@inheritdoc}
*/
public function setQueuedTime($queued) {
$this
->set('queued', (int) $queued);
}
/**
* {@inheritdoc}
*/
public function getType() {
$type = $this
->get('type')->entity;
if (empty($type)) {
if ($this
->id()) {
throw new EntityStorageException(strtr('The feed type "@type" for feed @id no longer exists.', [
'@type' => $this
->bundle(),
'@id' => $this
->id(),
]));
}
else {
throw new EntityStorageException(strtr('The feed type "@type" no longer exists.', [
'@type' => $this
->bundle(),
]));
}
}
return $type;
}
/**
* {@inheritdoc}
*/
public function getOwner() {
return $this
->get('uid')->entity;
}
/**
* {@inheritdoc}
*/
public function getOwnerId() {
return $this
->get('uid')->target_id;
}
/**
* {@inheritdoc}
*/
public function setOwnerId($uid) {
$this
->set('uid', $uid);
return $this;
}
/**
* {@inheritdoc}
*/
public function setOwner(UserInterface $account) {
$this
->set('uid', $account
->id());
return $this;
}
/**
* {@inheritdoc}
*/
public function isActive() {
return (bool) $this
->get('status')->value;
}
/**
* {@inheritdoc}
*/
public function setActive($active) {
$this
->set('status', $active ? static::ACTIVE : static::INACTIVE);
}
/**
* {@inheritdoc}
*/
public function import() {
$this
->entityTypeManager()
->getHandler('feeds_feed', 'feed_import')
->import($this);
}
/**
* {@inheritdoc}
*/
public function startBatchImport() {
$this
->entityTypeManager()
->getHandler('feeds_feed', 'feed_import')
->startBatchImport($this);
}
/**
* {@inheritdoc}
*/
public function startCronImport() {
$this
->entityTypeManager()
->getHandler('feeds_feed', 'feed_import')
->startCronImport($this);
}
/**
* {@inheritdoc}
*/
public function pushImport($raw) {
return $this
->entityTypeManager()
->getHandler('feeds_feed', 'feed_import')
->pushImport($this, $raw);
}
/**
* {@inheritdoc}
*/
public function startBatchClear() {
$this
->entityTypeManager()
->getHandler('feeds_feed', 'feed_clear')
->startBatchClear($this);
}
/**
* {@inheritdoc}
*/
public function startBatchExpire() {
return $this
->entityTypeManager()
->getHandler('feeds_feed', 'feed_expire')
->startBatchExpire($this);
}
/**
* {@inheritdoc}
*/
public function dispatchEntityEvent($event, EntityInterface $entity, ItemInterface $item) {
return $this
->eventDispatcher()
->dispatch($event, new EntityEvent($this, $entity, $item));
}
/**
* {@inheritdoc}
*/
public function finishImport() {
$time = time();
$this
->getType()
->getProcessor()
->postProcess($this, $this
->getState(StateInterface::PROCESS));
foreach ($this->states as $state) {
if (is_object($state)) {
$state
->displayMessages();
$state
->logMessages($this);
}
}
// Allow other modules to react upon finishing importing.
$this
->eventDispatcher()
->dispatch(FeedsEvents::IMPORT_FINISHED, new ImportFinishedEvent($this));
// Cleanup.
$this
->clearStates();
$this
->setQueuedTime(0);
$this
->set('imported', $time);
$interval = $this
->getType()
->getImportPeriod();
if ($interval !== FeedTypeInterface::SCHEDULE_NEVER) {
$this
->set('next', $interval + $time);
}
$this
->save();
$this
->unlock();
}
/**
* Cleans up after an import.
*/
public function finishClear() {
$this
->getType()
->getProcessor()
->postClear($this, $this
->getState(StateInterface::CLEAR));
foreach ($this->states as $state) {
is_object($state) ? $state
->displayMessages() : NULL;
}
$this
->clearStates();
}
/**
* {@inheritdoc}
*/
public function getState($stage) {
if (!isset($this->states[$stage])) {
$state = \Drupal::keyValue('feeds_feed.' . $this
->id())
->get($stage);
if (empty($state)) {
// @todo move this logic to a factory or alike.
switch ($stage) {
case StateInterface::CLEAN:
$state = new CleanState($this
->id());
break;
default:
$state = new State();
break;
}
}
$this->states[$stage] = $state;
}
return $this->states[$stage];
}
/**
* {@inheritdoc}
*/
public function setState($stage, StateInterface $state = NULL) {
$this->states[$stage] = $state;
}
/**
* {@inheritdoc}
*/
public function clearStates() {
$this->states = [];
\Drupal::keyValue('feeds_feed.' . $this
->id())
->deleteAll();
// Clean up references in feeds_clean_list table for this feed.
\Drupal::database()
->delete(CleanState::TABLE_NAME)
->condition('feed_id', $this
->id())
->execute();
}
/**
* {@inheritdoc}
*/
public function saveStates() {
\Drupal::keyValue('feeds_feed.' . $this
->id())
->setMultiple($this->states);
}
/**
* {@inheritdoc}
*/
public function progressFetching() {
return $this
->getState(StateInterface::FETCH)->progress;
}
/**
* {@inheritdoc}
*/
public function progressParsing() {
return $this
->getState(StateInterface::PARSE)->progress;
}
/**
* {@inheritdoc}
*/
public function progressImporting() {
$fetcher = $this
->getState(StateInterface::FETCH);
$parser = $this
->getState(StateInterface::PARSE);
if ($fetcher->progress === StateInterface::BATCH_COMPLETE && $parser->progress === StateInterface::BATCH_COMPLETE) {
return StateInterface::BATCH_COMPLETE;
}
// Fetching envelops parsing.
// @todo: this assumes all fetchers neatly use total. May not be the case.
$fetcher_fraction = $fetcher->total ? 1.0 / $fetcher->total : 1.0;
$parser_progress = $parser->progress * $fetcher_fraction;
$result = $fetcher->progress - $fetcher_fraction + $parser_progress;
if ($result >= StateInterface::BATCH_COMPLETE) {
return 0.99;
}
return $result;
}
/**
* {@inheritdoc}
*/
public function progressCleaning() {
return $this
->getState(StateInterface::CLEAN)->progress;
}
/**
* {@inheritdoc}
*/
public function progressClearing() {
return $this
->getState(StateInterface::CLEAR)->progress;
}
/**
* {@inheritdoc}
*/
public function progressExpiring() {
return $this
->getState(StateInterface::EXPIRE)->progress;
}
/**
* {@inheritdoc}
*/
public function getItemCount() {
return (int) $this
->get('item_count')->value;
}
/**
* {@inheritdoc}
*/
public function lock() {
if (!\Drupal::service('lock.persistent')
->acquire("feeds_feed_{$this->id()}", 3600 * 12)) {
$args = [
'@id' => $this
->bundle(),
'@fid' => $this
->id(),
];
throw new LockException(new FormattableMarkup('Cannot acquire lock for feed @id / @fid.', $args));
}
Cache::invalidateTags([
'feeds_feed_locked',
]);
}
/**
* {@inheritdoc}
*/
public function unlock() {
\Drupal::service('lock.persistent')
->release("feeds_feed_{$this->id()}");
Cache::invalidateTags([
'feeds_feed_locked',
]);
}
/**
* {@inheritdoc}
*/
public function isLocked() {
return !\Drupal::service('lock.persistent')
->lockMayBeAvailable("feeds_feed_{$this->id()}");
}
/**
* {@inheritdoc}
*/
public function getConfigurationFor(FeedsPluginInterface $client) {
$type = $client
->pluginType();
// @todo Figure out why for the UploadFetcher there is no config available.
$data = $this
->get('config')->{$type};
$data = !empty($data) ? $data : [];
return $data + $client
->defaultFeedConfiguration();
}
/**
* {@inheritdoc}
*/
public function setConfigurationFor(FeedsPluginInterface $client, array $configuration) {
$type = $client
->pluginType();
$this
->get('config')->{$type} = array_intersect_key($configuration, $client
->defaultFeedConfiguration()) + $client
->defaultFeedConfiguration();
}
/**
* {@inheritdoc}
*/
public function preSave(EntityStorageInterface $storage_controller, $update = TRUE) {
$feed_type = $this
->getType();
foreach ($feed_type
->getPlugins() as $plugin) {
$plugin
->onFeedSave($this, $update);
}
// If this is a new node, 'next' and 'imported' will be zero which will
// queue it for the next run.
if ($feed_type
->getImportPeriod() === FeedTypeInterface::SCHEDULE_NEVER) {
$this
->set('next', FeedTypeInterface::SCHEDULE_NEVER);
}
// Update the item count.
$this
->set('item_count', $feed_type
->getProcessor()
->getItemCount($this));
}
/**
* {@inheritdoc}
*/
public static function postDelete(EntityStorageInterface $storage_controller, array $feeds) {
// Delete values from other tables also referencing these feeds.
$ids = array_keys($feeds);
// Group feeds by type.
$grouped = [];
foreach ($feeds as $fid => $feed) {
$grouped[$feed
->bundle()][$fid] = $feed;
}
// Alert plugins that we are deleting.
foreach ($grouped as $group) {
// Grab the first feed to get its type.
$feed = reset($group);
try {
foreach ($feed
->getType()
->getPlugins() as $plugin) {
$plugin
->onFeedDeleteMultiple($group);
}
} catch (EntityStorageException $e) {
// Ignore the case where the feed type no longer exists, but do log an
// error.
$args = [
'%title' => $feed
->label(),
'@error' => $e
->getMessage(),
];
\Drupal::logger('feeds')
->warning('Could not perform some post cleanups for feed %title because of the following error: @error', $args);
}
}
// Clean up references in feeds_clean_list table for each feed.
\Drupal::database()
->delete(CleanState::TABLE_NAME)
->condition('feed_id', $ids, 'IN')
->execute();
\Drupal::service('event_dispatcher')
->dispatch(FeedsEvents::FEEDS_DELETE, new DeleteFeedsEvent($feeds));
}
/**
* {@inheritdoc}
*/
public static function baseFieldDefinitions(EntityTypeInterface $entity_type) {
$fields = [];
$fields['fid'] = BaseFieldDefinition::create('integer')
->setLabel(t('Feed ID'))
->setDescription(t('The feed ID.'))
->setReadOnly(TRUE)
->setSetting('unsigned', TRUE);
$fields['uuid'] = BaseFieldDefinition::create('uuid')
->setLabel(t('UUID'))
->setDescription(t('The feed UUID.'))
->setReadOnly(TRUE);
$fields['type'] = BaseFieldDefinition::create('entity_reference')
->setLabel(t('Feed type'))
->setDescription(t('The feed type.'))
->setSetting('target_type', 'feeds_feed_type')
->setReadOnly(TRUE);
$fields['title'] = BaseFieldDefinition::create('string')
->setLabel(t('Title'))
->setDescription(t('The title of this feed, always treated as non-markup plain text.'))
->setRequired(TRUE)
->setDefaultValue('')
->setSetting('max_length', 255)
->setDisplayOptions('view', [
'label' => 'hidden',
'type' => 'string',
'weight' => -5,
])
->setDisplayOptions('form', [
'type' => 'string_textfield',
'weight' => -5,
])
->setDisplayConfigurable('form', TRUE);
$fields['uid'] = BaseFieldDefinition::create('entity_reference')
->setLabel(t('Authored by'))
->setDescription(t('The user ID of the feed author.'))
->setRevisionable(TRUE)
->setSetting('target_type', 'user')
->setSetting('handler', 'default')
->setDefaultValueCallback('Drupal\\feeds\\Entity\\Feed::getCurrentUserId')
->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);
$fields['status'] = BaseFieldDefinition::create('boolean')
->setLabel(t('Importing status'))
->setDescription(t('A boolean indicating whether the feed is active.'))
->setDefaultValue(TRUE);
$fields['created'] = BaseFieldDefinition::create('created')
->setLabel(t('Authored on'))
->setDescription(t('The time that the feed was created.'))
->setDisplayOptions('view', [
'label' => 'hidden',
'type' => 'timestamp',
'weight' => 0,
])
->setDisplayOptions('form', [
'type' => 'datetime_timestamp',
'weight' => 10,
])
->setDisplayConfigurable('form', TRUE);
$fields['changed'] = BaseFieldDefinition::create('changed')
->setLabel(t('Changed'))
->setDescription(t('The time that the feed was last edited.'));
$fields['imported'] = BaseFieldDefinition::create('timestamp')
->setLabel(t('Last import'))
->setDescription(t('The time that the feed was imported.'))
->setDefaultValue(0)
->setDisplayOptions('view', [
'label' => 'inline',
'type' => 'timestamp_ago',
'weight' => 1,
])
->setDisplayConfigurable('view', TRUE);
$fields['next'] = BaseFieldDefinition::create('timestamp')
->setLabel(t('Next import'))
->setDescription(t('The time that the feed will import next.'))
->setDefaultValue(0)
->setDisplayOptions('view', [
'label' => 'inline',
'type' => 'timestamp',
'weight' => 1,
])
->setDisplayConfigurable('view', TRUE);
$fields['queued'] = BaseFieldDefinition::create('timestamp')
->setLabel(t('Queued'))
->setDescription(t('Time when this feed was queued for refresh, 0 if not queued.'))
->setDefaultValue(0);
$fields['source'] = BaseFieldDefinition::create('uri')
->setLabel(t('Source'))
->setDescription(t('The source of the feed.'))
->setRequired(TRUE)
->setDisplayOptions('view', [
'label' => 'inline',
'type' => 'feeds_uri_link',
'weight' => -3,
])
->setDisplayConfigurable('view', TRUE);
$fields['config'] = BaseFieldDefinition::create('map')
->setLabel(t('Config'))
->setDescription(t('The config of the feed.'));
$fields['item_count'] = BaseFieldDefinition::create('integer')
->setLabel(t('Items imported'))
->setDescription(t('The number of items imported.'))
->setDefaultValue(0)
->setDisplayOptions('view', [
'label' => 'inline',
'type' => 'number_integer',
'weight' => 0,
]);
return $fields;
}
/**
* 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(),
];
}
}
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:: |
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 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 |
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 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 an array of placeholders for this entity. | 2 |
EntityBase:: |
protected | function | Gets the UUID generator. | |
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 | |
Feed:: |
protected | property | An array of import stage states keyed by state. | |
Feed:: |
public static | function |
Provides base field definitions for an entity type. Overrides ContentEntityBase:: |
|
Feed:: |
public | function |
Clears all state objects for the feed. Overrides FeedInterface:: |
|
Feed:: |
public | function |
Dispatches an entity event. Overrides FeedInterface:: |
|
Feed:: |
protected | function | Gets the event dispatcher. | |
Feed:: |
public | function |
Cleans up after an import. Overrides FeedInterface:: |
|
Feed:: |
public | function |
Cleans up after an import. Overrides FeedInterface:: |
|
Feed:: |
public | function |
Gets the timestamp of the last entity change for the current translation. Overrides EntityChangedTrait:: |
|
Feed:: |
public | function |
Returns the configuration for a specific client plugin. Overrides FeedInterface:: |
|
Feed:: |
public | function |
Returns the feed creation timestamp. Overrides FeedInterface:: |
|
Feed:: |
public static | function | Default value callback for 'uid' base field definition. | |
Feed:: |
public | function |
Returns the feed imported timestamp. Overrides FeedInterface:: |
|
Feed:: |
public | function |
Counts items imported by this feed. Overrides FeedInterface:: |
|
Feed:: |
public | function |
Returns the next time the feed will be imported. Overrides FeedInterface:: |
|
Feed:: |
public | function |
Returns the entity owner's user entity. Overrides EntityOwnerInterface:: |
|
Feed:: |
public | function |
Returns the entity owner's user ID. Overrides EntityOwnerInterface:: |
|
Feed:: |
public | function |
Returns the time when this feed was queued for refresh, 0 if not queued. Overrides FeedInterface:: |
|
Feed:: |
public | function |
Returns the source of the feed. Overrides FeedInterface:: |
|
Feed:: |
public | function |
Returns a state object for a given stage. Overrides FeedInterface:: |
|
Feed:: |
public | function |
Returns the feed type object that this feed is expected to be used with. Overrides FeedInterface:: |
|
Feed:: |
public | function |
Gets the identifier. Overrides ContentEntityBase:: |
|
Feed:: |
public | function |
Imports the whole feed at once. Overrides FeedInterface:: |
|
Feed:: |
public | function |
Returns the feed active status. Overrides FeedInterface:: |
|
Feed:: |
public | function |
Checks whether a feed is locked. Overrides FeedInterface:: |
|
Feed:: |
public | function |
Gets the label of the entity. Overrides ContentEntityBase:: |
|
Feed:: |
public | function |
Locks a feed. Overrides FeedInterface:: |
|
Feed:: |
public static | function |
Acts on deleted entities before the delete hook is invoked. Overrides EntityBase:: |
|
Feed:: |
public | function |
Acts on an entity before the presave hook is invoked. Overrides ContentEntityBase:: |
|
Feed:: |
public | function |
Reports progress on cleaning. Overrides FeedInterface:: |
|
Feed:: |
public | function |
Reports progress on clearing. Overrides FeedInterface:: |
|
Feed:: |
public | function |
Reports progress on expiry. Overrides FeedInterface:: |
|
Feed:: |
public | function |
Reports the progress of the fetching stage. Overrides FeedInterface:: |
|
Feed:: |
public | function |
Reports the progress of the import process. Overrides FeedInterface:: |
|
Feed:: |
public | function |
Reports the progress of the parsing stage. Overrides FeedInterface:: |
|
Feed:: |
public | function |
Imports a raw string. Overrides FeedInterface:: |
|
Feed:: |
public | function |
Saves all state objects on the key/value collection of the feed. Overrides FeedInterface:: |
|
Feed:: |
public | function |
Sets the active status of a feed. Overrides FeedInterface:: |
|
Feed:: |
public | function |
Sets the configuration for a specific client plugin. Overrides FeedInterface:: |
|
Feed:: |
public | function |
Sets the feed creation timestamp. Overrides FeedInterface:: |
|
Feed:: |
public | function |
Sets the entity owner's user entity. Overrides EntityOwnerInterface:: |
|
Feed:: |
public | function |
Sets the entity owner's user ID. Overrides EntityOwnerInterface:: |
|
Feed:: |
public | function |
Sets the time when this feed was queued for refresh, 0 if not queued. Overrides FeedInterface:: |
|
Feed:: |
public | function |
Sets the feed source. Overrides FeedInterface:: |
|
Feed:: |
public | function |
Sets a state object for a given stage. Overrides FeedInterface:: |
|
Feed:: |
public | function |
Start deleting all imported items of a feed via the batch API. Overrides FeedInterface:: |
|
Feed:: |
public | function |
Removes all expired items from a feed via batch api. Overrides FeedInterface:: |
|
Feed:: |
public | function |
Starts importing a feed via the batch API. Overrides FeedInterface:: |
|
Feed:: |
public | function |
Starts importing a feed via cron. Overrides FeedInterface:: |
|
Feed:: |
public | function |
Unlocks a feed. Overrides FeedInterface:: |
|
Feed:: |
public | function |
Implements the magic __wakeup function to reset states. Overrides DependencySerializationTrait:: |
|
FeedInterface:: |
constant | Represents an active feed. | ||
FeedInterface:: |
constant | Represents an inactive feed. | ||
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. |