You are here

public function ItemStorage::getItemCount in MongoDB 8

Returns the count of the items in a feed.

Parameters

\Drupal\aggregator\FeedInterface $feed: The feed entity.

Return value

int The count of items associated with a feed.

Overrides ItemStorageInterface::getItemCount

File

mongodb_aggregator/src/Entity/ItemStorage.php, line 25
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

public function getItemCount(FeedInterface $feed) {
  $query = \Drupal::entityQuery('aggregator_item')
    ->condition('fid', $feed
    ->id())
    ->count();
  return $query
    ->execute();
}