ItemStorageInterface.php 1.1 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647
  1. <?php
  2. namespace Drupal\aggregator;
  3. use Drupal\Core\Entity\ContentEntityStorageInterface;
  4. /**
  5. * Defines an interface for aggregator item entity storage classes.
  6. */
  7. interface ItemStorageInterface extends ContentEntityStorageInterface {
  8. /**
  9. * Returns the count of the items in a feed.
  10. *
  11. * @param \Drupal\aggregator\FeedInterface $feed
  12. * The feed entity.
  13. *
  14. * @return int
  15. * The count of items associated with a feed.
  16. */
  17. public function getItemCount(FeedInterface $feed);
  18. /**
  19. * Loads feed items from all feeds.
  20. *
  21. * @param int $limit
  22. * (optional) The number of items to return. Defaults to unlimited.
  23. *
  24. * @return \Drupal\aggregator\ItemInterface[]
  25. * An array of the feed items.
  26. */
  27. public function loadAll($limit = NULL);
  28. /**
  29. * Loads feed items filtered by a feed.
  30. *
  31. * @param int $fid
  32. * The feed ID to filter by.
  33. * @param int $limit
  34. * (optional) The number of items to return. Defaults to unlimited.
  35. *
  36. * @return \Drupal\aggregator\ItemInterface[]
  37. * An array of the feed items.
  38. */
  39. public function loadByFeed($fid, $limit = NULL);
  40. }