public function ItemStorage::getItemCount in Drupal 9
Same name and namespace in other branches
- 8 core/modules/aggregator/src/ItemStorage.php \Drupal\aggregator\ItemStorage::getItemCount()
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
- core/
modules/ aggregator/ src/ ItemStorage.php, line 19
Class
- ItemStorage
- Defines the storage handler class for feed item entities.
Namespace
Drupal\aggregatorCode
public function getItemCount(FeedInterface $feed) {
$query = \Drupal::entityQuery('aggregator_item')
->accessCheck(FALSE)
->condition('fid', $feed
->id())
->count();
return $query
->execute();
}