Missing doc block, removed parse() parameter.
Missing doc block, removed parse() parameter.
This commit is contained in:
parent
7c02af8896
commit
ea3856673d
@ -119,6 +119,7 @@ class Paginator implements \Countable, \IteratorAggregate
|
|||||||
{
|
{
|
||||||
if ($this->count === null) {
|
if ($this->count === null) {
|
||||||
$countQuery = $this->getCountQuery();
|
$countQuery = $this->getCountQuery();
|
||||||
|
|
||||||
try {
|
try {
|
||||||
$data = $countQuery->getScalarResult();
|
$data = $countQuery->getScalarResult();
|
||||||
$data = array_map('current', $data);
|
$data = array_map('current', $data);
|
||||||
@ -130,8 +131,13 @@ class Paginator implements \Countable, \IteratorAggregate
|
|||||||
|
|
||||||
return $this->count;
|
return $this->count;
|
||||||
}
|
}
|
||||||
|
/**
|
||||||
public function getCountQuery(){
|
* Returns Query prepared to count.
|
||||||
|
*
|
||||||
|
* @return Query
|
||||||
|
*/
|
||||||
|
public function getCountQuery()
|
||||||
|
{
|
||||||
/* @var $countQuery Query */
|
/* @var $countQuery Query */
|
||||||
$countQuery = $this->cloneQuery($this->query);
|
$countQuery = $this->cloneQuery($this->query);
|
||||||
|
|
||||||
@ -153,7 +159,7 @@ class Paginator implements \Countable, \IteratorAggregate
|
|||||||
|
|
||||||
$countQuery->setFirstResult(null)->setMaxResults(null);
|
$countQuery->setFirstResult(null)->setMaxResults(null);
|
||||||
$parser = new Query\Parser($countQuery);
|
$parser = new Query\Parser($countQuery);
|
||||||
$parameterMappings = $parser->parse($parser)->getParameterMappings();
|
$parameterMappings = $parser->parse()->getParameterMappings();
|
||||||
$parameters = $countQuery->getParameters();
|
$parameters = $countQuery->getParameters();
|
||||||
foreach ($parameters as $k => $param){
|
foreach ($parameters as $k => $param){
|
||||||
if( ! array_key_exists($param->getName(), $parameterMappings)) {
|
if( ! array_key_exists($param->getName(), $parameterMappings)) {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user