I'm using drupal pagination here i have add some part of my code pagination is working perfect while I'm trying to get the total no of record it is always displaying 10. As i understand i have set the limit 10 so it displaying only total 10
$query->orderBy('r.published_date', 'DESC');
$pager = $query->extend('Drupal\Core\Database\Query\PagerSelectExtender')->limit(10);
$results = $pager->execute()->fetchAll();
This $results
variable I'm getting data with the set of 10 values.
I would like to display total no of data for that i have created other variable where i have directly executed query in $result
so it could give total no of records but its not working it displaying only 10
$result = $query->execute();
while($data = $result->fetchObject()){
$count_ret[]=$data->published_date;
}
$total=count($count_ret);
please guide me where i'm doing wrong