class Feed

Same name in this branch

Defines the aggregator feed entity class.

Plugin annotation


@EntityType(
  id = "aggregator_feed",
  label = @Translation("Aggregator feed"),
  module = "aggregator",
  controllers = {
    "storage" = "Drupal\aggregator\FeedStorageController",
    "render" = "Drupal\aggregator\FeedRenderController",
    "form" = {
      "default" = "Drupal\aggregator\FeedFormController"
    }
  },
  base_table = "aggregator_feed",
  fieldable = TRUE,
  entity_keys = {
    "id" = "fid",
    "label" = "title",
  }
)

Hierarchy

Expanded class hierarchy of Feed

15 files declare their use of Feed
aggregator.admin.inc in drupal/core/modules/aggregator/aggregator.admin.inc
Administration page callbacks for the Aggregator module.
aggregator.module in drupal/core/modules/aggregator/aggregator.module
Used to aggregate syndicated content (RSS, RDF, and Atom).
aggregator.pages.inc in drupal/core/modules/aggregator/aggregator.pages.inc
User page callbacks for the Aggregator module.
AggregatorTestBase.php in drupal/core/modules/aggregator/lib/Drupal/aggregator/Tests/AggregatorTestBase.php
Definition of Drupal\aggregator\Tests\AggregatorTestBase.
DefaultFetcher.php in drupal/core/modules/aggregator/lib/Drupal/aggregator/Plugin/aggregator/fetcher/DefaultFetcher.php
Contains \Drupal\aggregator\Plugin\aggregator\fetcher\DefaultFetcher.

... See full list

8 string references to 'Feed'
views.view.frontpage.yml in drupal/core/modules/node/config/views.view.frontpage.yml
drupal/core/modules/node/config/views.view.frontpage.yml
views.view.taxonomy_term.yml in drupal/core/modules/views/config/views.view.taxonomy_term.yml
drupal/core/modules/views/config/views.view.taxonomy_term.yml
views.view.test_attachment_ui.yml in drupal/core/modules/views/tests/views_test_config/test_views/views.view.test_attachment_ui.yml
drupal/core/modules/views/tests/views_test_config/test_views/views.view.test_attachment_ui.yml
views.view.test_comment_rss.yml in drupal/core/modules/comment/tests/modules/comment_test_views/test_views/views.view.test_comment_rss.yml
drupal/core/modules/comment/tests/modules/comment_test_views/test_views/views.view.test_comment_rss.yml
views.view.test_feed_display.yml in drupal/core/modules/views/tests/views_test_config/test_views/views.view.test_feed_display.yml
drupal/core/modules/views/tests/views_test_config/test_views/views.view.test_feed_display.yml

... See full list

File

drupal/core/modules/aggregator/lib/Drupal/aggregator/Plugin/Core/Entity/Feed.php, line 37
Contains \Drupal\aggregator\Plugin\Core\Entity\Feed.

Namespace

Drupal\aggregator\Plugin\Core\Entity
View source
class Feed extends EntityNG implements FeedInterface {

  /**
   * The feed ID.
   *
   * @todo rename to id.
   *
   * @var \Drupal\Core\Entity\Field\FieldInterface
   */
  public $fid;

  /**
   * Title of the feed.
   *
   * @var \Drupal\Core\Entity\Field\FieldInterface
   */
  public $title;

  /**
   * The feed language code.
   *
   * @var \Drupal\Core\Entity\Field\FieldInterface
   */
  public $langcode;

  /**
   * URL to the feed.
   *
   * @var \Drupal\Core\Entity\Field\FieldInterface
   */
  public $url;

  /**
   * How often to check for new feed items, in seconds.
   *
   * @var \Drupal\Core\Entity\Field\FieldInterface
   */
  public $refresh;

  /**
   * Last time feed was checked for new items, as Unix timestamp.
   *
   * @var \Drupal\Core\Entity\Field\FieldInterface
   */
  public $checked;

  /**
   * Time when this feed was queued for refresh, 0 if not queued.
   *
   * @var \Drupal\Core\Entity\Field\FieldInterface
   */
  public $queued;

  /**
   * The parent website of the feed; comes from the <link> element in the feed.
   *
   * @var \Drupal\Core\Entity\Field\FieldInterface
   */
  public $link;

  /**
   * The parent website's description;
   * comes from the <description> element in the feed.
   *
   * @var \Drupal\Core\Entity\Field\FieldInterface
   */
  public $description;

  /**
   * An image representing the feed.
   *
   * @var \Drupal\Core\Entity\Field\FieldInterface
   */
  public $image;

  /**
   * Calculated hash of the feed data, used for validating cache.
   *
   * @var \Drupal\Core\Entity\Field\FieldInterface
   */
  public $hash;

  /**
   * Entity tag HTTP response header, used for validating cache.
   *
   * @var \Drupal\Core\Entity\Field\FieldInterface
   */
  public $etag;

  /**
   * When the feed was last modified, as a Unix timestamp.
   *
   * @var \Drupal\Core\Entity\Field\FieldInterface
   */
  public $modified;

  /**
   * Number of items to display in the feed’s block.
   *
   * @var \Drupal\Core\Entity\Field\FieldInterface
   */
  public $block;

  /**
   * Overrides Drupal\Core\Entity\EntityNG::init().
   */
  public function init() {
    parent::init();

    // We unset all defined properties, so magic getters apply.
    unset($this->fid);
    unset($this->title);
    unset($this->url);
    unset($this->refresh);
    unset($this->checked);
    unset($this->queued);
    unset($this->link);
    unset($this->description);
    unset($this->image);
    unset($this->hash);
    unset($this->etag);
    unset($this->modified);
    unset($this->block);
  }

  /**
   * Implements Drupal\Core\Entity\EntityInterface::id().
   */
  public function id() {
    return $this
      ->get('fid')->value;
  }

  /**
   * Implements Drupal\Core\Entity\EntityInterface::label().
   */
  public function label($langcode = NULL) {
    return $this
      ->get('title')->value;
  }

}

Members

Namesort descending Modifiers Type Description Overrides
Entity::$enforceIsNew protected property Boolean indicating whether the entity should be forced to be new.
Entity::$entityType protected property The entity type.
Entity::$isDefaultRevision protected property Indicates whether this is the default revision. 1
Entity::$newRevision protected property Boolean indicating whether a new revision should be created on save.
Entity::access public function Implements \Drupal\Core\TypedData\AccessibleInterface::access(). Overrides AccessibleInterface::access
Entity::delete public function Implements \Drupal\Core\Entity\EntityInterface::delete(). Overrides EntityInterface::delete 3
Entity::enforceIsNew public function Implements \Drupal\Core\Entity\EntityInterface::enforceIsNew(). Overrides EntityInterface::enforceIsNew
Entity::entityInfo public function Implements \Drupal\Core\Entity\EntityInterface::entityInfo(). Overrides EntityInterface::entityInfo
Entity::entityType public function Implements \Drupal\Core\Entity\EntityInterface::entityType(). Overrides EntityInterface::entityType
Entity::getConstraints public function Implements \Drupal\Core\TypedData\TypedDataInterface::getConstraints(). Overrides TypedDataInterface::getConstraints
Entity::getDefinition public function Implements \Drupal\Core\TypedData\TypedDataInterface::getDefinition(). Overrides TypedDataInterface::getDefinition
Entity::getExportProperties public function Implements \Drupal\Core\Entity\EntityInterface::getExportProperties(). Overrides EntityInterface::getExportProperties 1
Entity::getName public function Implements \Drupal\Core\TypedData\TypedDataInterface::getName(). Overrides TypedDataInterface::getName
Entity::getNGEntity public function Implements \Drupal\Core\Entity\EntityInterface::getNGEntity(). Overrides EntityInterface::getNGEntity
Entity::getParent public function Implements \Drupal\Core\TypedData\TypedDataInterface::getParent(). Overrides TypedDataInterface::getParent
Entity::getPropertyPath public function Implements \Drupal\Core\TypedData\TypedDataInterface::getPropertyPath(). Overrides TypedDataInterface::getPropertyPath
Entity::getRevisionId public function Implements \Drupal\Core\Entity\EntityInterface::getRevisionId(). Overrides EntityInterface::getRevisionId 4
Entity::getRoot public function Implements \Drupal\Core\TypedData\TypedDataInterface::getRoot(). Overrides TypedDataInterface::getRoot
Entity::getString public function Implements \Drupal\Core\TypedData\TypedDataInterface::getString(). Overrides TypedDataInterface::getString
Entity::getValue public function Implements \Drupal\Core\TypedData\TypedDataInterface::getValue(). Overrides TypedDataInterface::getValue
Entity::isDefaultRevision public function Implements \Drupal\Core\Entity\EntityInterface::isDefaultRevision(). Overrides EntityInterface::isDefaultRevision 1
Entity::isNew public function Implements \Drupal\Core\Entity\EntityInterface::isNew(). Overrides EntityInterface::isNew 1
Entity::isNewRevision public function Implements \Drupal\Core\Entity\EntityInterface::isNewRevision(). Overrides EntityInterface::isNewRevision
Entity::isTranslatable public function Implements \Drupal\Core\Entity\EntityInterface::isTranslatable(). Overrides EntityInterface::isTranslatable
Entity::onChange public function Implements \Drupal\Core\TypedData\ComplexDataInterface::onChange(). Overrides ComplexDataInterface::onChange
Entity::save public function Implements \Drupal\Core\Entity\EntityInterface::save(). Overrides EntityInterface::save 6
Entity::setContext public function Implements \Drupal\Core\TypedData\TypedDataInterface::setContext(). Overrides TypedDataInterface::setContext
Entity::setNewRevision public function Implements \Drupal\Core\Entity\EntityInterface::setNewRevision(). Overrides EntityInterface::setNewRevision
Entity::setValue public function Implements \Drupal\Core\TypedData\TypedDataInterface::setValue(). Overrides TypedDataInterface::setValue
Entity::uriRelationships public function Returns a list of URI relationships supported by this entity. Overrides EntityInterface::uriRelationships
EntityNG::$bcEntity protected property An instance of the backward compatibility decorator.
EntityNG::$bundle protected property Local cache holding the value of the bundle field.
EntityNG::$fieldDefinitions protected property Local cache for field definitions.
EntityNG::$fields protected property The array of fields, each being an instance of FieldInterface.
EntityNG::$uriPlaceholderReplacements protected property Local cache for URI placeholder substitution values.
EntityNG::$values protected property The plain data values of the contained fields. 3
EntityNG::bundle public function Implements \Drupal\Core\Entity\EntityInterface::bundle(). Overrides Entity::bundle
EntityNG::createDuplicate public function Overrides Entity::createDuplicate(). Overrides Entity::createDuplicate 1
EntityNG::get public function Implements \Drupal\Core\TypedData\ComplexDataInterface::get(). Overrides Entity::get
EntityNG::getBCEntity public function Overrides Entity::getBCEntity(). Overrides Entity::getBCEntity 2
EntityNG::getIterator public function Implements \IteratorAggregate::getIterator(). Overrides Entity::getIterator
EntityNG::getProperties public function Implements \Drupal\Core\TypedData\ComplexDataInterface::getProperties(). Overrides Entity::getProperties
EntityNG::getPropertyDefinition public function Implements \Drupal\Core\TypedData\ComplexDataInterface::getPropertyDefinition(). Overrides Entity::getPropertyDefinition
EntityNG::getPropertyDefinitions public function Implements \Drupal\Core\TypedData\ComplexDataInterface::getPropertyDefinitions(). Overrides Entity::getPropertyDefinitions
EntityNG::getPropertyValues public function Implements \Drupal\Core\TypedData\ComplexDataInterface::getPropertyValues(). Overrides Entity::getPropertyValues
EntityNG::getTranslatedField protected function Gets a translated field.
EntityNG::getTranslation public function Implements \Drupal\Core\TypedData\TranslatableInterface::getTranslation(). Overrides Entity::getTranslation
EntityNG::getTranslationLanguages public function Implements \Drupal\Core\TypedData\TranslatableInterface::getTranslationLanguages(). Overrides Entity::getTranslationLanguages
EntityNG::getType public function Gets the typed data type of the entity. Overrides Entity::getType
EntityNG::isEmpty public function Implements \Drupal\Core\TypedData\ComplexDataInterface::isEmpty(). Overrides Entity::isEmpty
EntityNG::language public function Implements \Drupal\Core\TypedData\TranslatableInterface::language(). Overrides Entity::language
EntityNG::set public function Implements \Drupal\Core\TypedData\ComplexDataInterface::set(). Overrides Entity::set
EntityNG::setPropertyValues public function Implements \Drupal\Core\TypedData\ComplexDataInterface::setPropertyValues(). Overrides Entity::setPropertyValues
EntityNG::translations public function Overrides Entity::translations(). Overrides Entity::translations
EntityNG::updateOriginalValues public function Updates the original values with the interim changes.
EntityNG::uri public function Implements \Drupal\Core\Entity\EntityInterface::uri(). Overrides Entity::uri 1
EntityNG::uriPlaceholderReplacements protected function Returns an array of placeholders for this entity.
EntityNG::uuid public function Overrides Entity::uuid(). Overrides Entity::uuid
EntityNG::validate public function Implements \Drupal\Core\TypedData\TypedDataInterface::validate(). Overrides Entity::validate
EntityNG::__clone public function Magic method: Implements a deep clone.
EntityNG::__construct public function Overrides Entity::__construct(). Overrides Entity::__construct
EntityNG::__get public function Implements the magic method for setting object properties.
EntityNG::__isset public function Implements the magic method for isset().
EntityNG::__set public function Implements the magic method for setting object properties.
EntityNG::__unset public function Implements the magic method for unset.
EntityNG::__wakeup public function Magic __wakeup() implementation.
Feed::$block public property Number of items to display in the feed’s block.
Feed::$checked public property Last time feed was checked for new items, as Unix timestamp.
Feed::$description public property The parent website's description; comes from the <description> element in the feed.
Feed::$etag public property Entity tag HTTP response header, used for validating cache.
Feed::$fid public property The feed ID.
Feed::$hash public property Calculated hash of the feed data, used for validating cache.
Feed::$image public property An image representing the feed.
Feed::$langcode public property The feed language code. Overrides Entity::$langcode
Feed::$link public property The parent website of the feed; comes from the <link> element in the feed.
Feed::$modified public property When the feed was last modified, as a Unix timestamp.
Feed::$queued public property Time when this feed was queued for refresh, 0 if not queued.
Feed::$refresh public property How often to check for new feed items, in seconds.
Feed::$title public property Title of the feed.
Feed::$url public property URL to the feed.
Feed::id public function Implements Drupal\Core\Entity\EntityInterface::id(). Overrides EntityNG::id
Feed::init public function Overrides Drupal\Core\Entity\EntityNG::init(). Overrides EntityNG::init
Feed::label public function Implements Drupal\Core\Entity\EntityInterface::label(). Overrides EntityNG::label