Completed
Pull Request — master (#258)
by
unknown
10:36
created

RawDoctrine   A

Complexity

Total Complexity 3

Size/Duplication

Total Lines 14
Duplicated Lines 0 %

Coupling/Cohesion

Components 1
Dependencies 4

Importance

Changes 1
Bugs 0 Features 0
Metric Value
wmc 3
c 1
b 0
f 0
lcom 1
cbo 4
dl 0
loc 14
rs 10

1 Method

Rating   Name   Duplication   Size   Complexity  
A getData() 0 10 3
1
<?php
2
namespace Grido\DataSources;
3
4
5
use Doctrine\ORM\Tools\Pagination\Paginator;
6
7
use Grido\DataSources\Doctrine;
8
9
class RawDoctrine extends Doctrine{
10
11
	public function getData()
12
	{
13
		// Paginator is better if the query uses ManyToMany associations
14
		$result = $this->qb->getMaxResults() !== NULL || $this->qb->getFirstResult() !== NULL
15
			? new Paginator($this->getQuery())
16
			: $this->qb->getQuery()->getResult();
17
18
19
		return $result;
20
	}
21
22
}