You are here

protected function ItemStorage::executeFeedItemQuery in MongoDB 8

Helper method to execute an item query.

Parameters

\Drupal\Core\Entity\Query\QueryInterface $query: The query to execute.

int $limit: (optional) The number of items to return.

Return value

\Drupal\aggregator\ItemInterface[] An array of the feed items.

2 calls to ItemStorage::executeFeedItemQuery()
ItemStorage::loadAll in mongodb_aggregator/src/Entity/ItemStorage.php
Loads feed items from all feeds.
ItemStorage::loadByFeed in mongodb_aggregator/src/Entity/ItemStorage.php
Loads feed items filtered by a feed.

File

mongodb_aggregator/src/Entity/ItemStorage.php, line 61
Contains \Drupal\aggregator\ItemStorage.

Class

ItemStorage
This is 100% identical to the core item storage class, should be removed if core removes.

Namespace

Drupal\mongodb_aggregator\Entity

Code

protected function executeFeedItemQuery(QueryInterface $query, $limit) {
  $query
    ->sort('timestamp', 'DESC')
    ->sort('iid', 'DESC');
  if (!empty($limit)) {
    $query
      ->pager($limit);
  }
  return $this
    ->loadMultiple($query
    ->execute());
}