1
0
mirror of synced 2025-02-02 13:31:45 +03:00

Missing doc block, removed parse() parameter.

Missing doc block, removed parse() parameter.
This commit is contained in:
Paweł Kolanowski 2014-11-27 08:11:27 +01:00 committed by Marco Pivetta
parent 7c02af8896
commit ea3856673d

View File

@ -119,6 +119,7 @@ class Paginator implements \Countable, \IteratorAggregate
{
if ($this->count === null) {
$countQuery = $this->getCountQuery();
try {
$data = $countQuery->getScalarResult();
$data = array_map('current', $data);
@ -130,8 +131,13 @@ class Paginator implements \Countable, \IteratorAggregate
return $this->count;
}
public function getCountQuery(){
/**
* Returns Query prepared to count.
*
* @return Query
*/
public function getCountQuery()
{
/* @var $countQuery Query */
$countQuery = $this->cloneQuery($this->query);
@ -153,7 +159,7 @@ class Paginator implements \Countable, \IteratorAggregate
$countQuery->setFirstResult(null)->setMaxResults(null);
$parser = new Query\Parser($countQuery);
$parameterMappings = $parser->parse($parser)->getParameterMappings();
$parameterMappings = $parser->parse()->getParameterMappings();
$parameters = $countQuery->getParameters();
foreach ($parameters as $k => $param){
if( ! array_key_exists($param->getName(), $parameterMappings)) {