GitHub Access Token became invalid

It seems like the GitHub access token used for retrieving details about this repository from GitHub became invalid. This might prevent certain types of inspections from being run (in particular, everything related to pull requests).
Please ask an admin of your repository to re-new the access token on this website.
Passed
Pull Request — master (#52)
by Simone
03:32
created

QueryBuilderFactory   F

Complexity

Total Complexity 82

Size/Duplication

Total Lines 564
Duplicated Lines 22.7 %

Test Coverage

Coverage 49.47%

Importance

Changes 0
Metric Value
dl 128
loc 564
ccs 140
cts 283
cp 0.4947
rs 1.5789
c 0
b 0
f 0
wmc 82

35 Methods

Rating   Name   Duplication   Size   Complexity  
A getPrinting() 0 3 1
A getSelect() 0 3 1
A getRel() 0 3 1
A buildSelectValue() 0 9 2
A setPageLength() 0 5 1
A getPageLength() 0 3 1
A getEntityManager() 0 3 1
A setPage() 0 5 1
A getPage() 0 3 1
A setFilters() 0 5 1
A ensureFieldsDefined() 0 5 2
B join() 0 43 5
A getFields() 0 5 1
A setRelationEntityAlias() 0 3 1
B sort() 0 29 6
A ensureSortingIsDefined() 0 5 2
A getAvailableFilters() 0 3 1
A storeJoin() 0 4 1
A ensureFilteringIsDefined() 0 5 2
A getFilters() 0 3 1
A noExistsJoin() 0 9 2
A getRelationEntityAlias() 0 3 1
C filter() 0 28 7
A setOrFilters() 0 5 1
F applyFilterOr() 72 121 15
A setPrinting() 0 5 1
A getOrFilters() 0 3 1
D applyFilterAnd() 56 103 13
A ensureQueryBuilderIsDefined() 0 5 2
A ensureFieldsDefinedPublic() 0 3 1
A setSorting() 0 5 1
A setRel() 0 5 1
A setSelect() 0 5 1
A getQueryBuilder() 0 5 1
A setFields() 0 5 1

How to fix   Duplicated Code    Complexity   

Duplicated Code

Duplicate code is one of the most pungent code smells. A rule that is often used is to re-structure code once it is duplicated in three or more places.

Common duplication problems, and corresponding solutions are:

Complex Class

 Tip:   Before tackling complexity, make sure that you eliminate any duplication first. This often can reduce the size of classes significantly.

Complex classes like QueryBuilderFactory often do a lot of different things. To break such a class down, we need to identify a cohesive component within that class. A common approach to find such a component is to look for fields/methods that share the same prefixes, or suffixes.

Once you have determined the fields that belong together, you can apply the Extract Class refactoring. If the component makes sense as a sub-class, Extract Subclass is also a candidate, and is often faster.

While breaking up the class, it is a good idea to analyze how other classes use QueryBuilderFactory, and based on these observations, apply Extract Interface, too.

1
<?php
2
3
namespace Mado\QueryBundle\Queries;
4
5
use Mado\QueryBundle\Objects\FilteringObject;
6
use Mado\QueryBundle\Objects\Operator;
7
use Mado\QueryBundle\Objects\Salt;
8
use Mado\QueryBundle\Vocabulary\Operators;
9
10
class QueryBuilderFactory extends AbstractQuery
11
{
12
    const DIRECTION_AZ = 'asc';
13
14
    const DIRECTION_ZA = 'desc';
15
16
    protected $qBuilder;
17
18
    protected $fields;
19
20
    protected $filtering;
21
22
    protected $orFiltering;
23
24
    protected $relationEntityAlias;
25
26
    protected $sorting;
27
28
    protected $joins;
29
30
    protected $rel;
31
32
    protected $printing;
33
34
    protected $page;
35
36
    protected $pageLength;
37
38
    protected $select;
39
40 1
    public function ensureFieldsDefinedPublic()
41
    {
42 1
        $this->ensureFieldsDefined();
43
    }
44
45 6
    private function ensureFieldsDefined()
46
    {
47 6
        if (!$this->fields) {
48 1
            throw new \RuntimeException(
49 1
                'Oops! Fields are not defined'
50
            );
51
        }
52 5
    }
53
54 3
    private function ensureSortingIsDefined()
55
    {
56 3
        if (null === $this->sorting) {
57
            throw new \RuntimeException(
58
                'Oops! Sorting is not defined'
59
            );
60
        }
61 3
    }
62
63 5
    private function ensureFilteringIsDefined()
64
    {
65 5
        if (null === $this->filtering) {
66
            throw new \RuntimeException(
67
                'Oops! Filtering is not defined'
68
            );
69
        }
70 5
    }
71
72 6
    private function ensureQueryBuilderIsDefined()
73
    {
74 6
        if (!$this->qBuilder) {
75
            throw new \RuntimeException(
76
                "Oops! Query builder was never initialized! call ::createQueryBuilder('entityName', 'alias') to start."
77
            );
78
        }
79 6
    }
80
81 1
    public function getAvailableFilters()
82
    {
83 1
        return array_keys(Operators::getAll());
84
    }
85
86 6
    public function setFields(array $fields = [])
87
    {
88 6
        $this->fields = $fields;
89
90 6
        return $this;
91
    }
92
93
    public function getFields()
94
    {
95
        $this->ensureFieldsDefined();
96
97
        return $this->fields;
98
    }
99
100 6
    public function setFilters(array $filtering = [])
101
    {
102 6
        $this->filtering = $filtering;
103
104 6
        return $this;
105
    }
106
107 4
    public function setOrFilters(array $orFiltering = [])
108
    {
109 4
        $this->orFiltering = $orFiltering;
110
111 4
        return $this;
112
    }
113
114 4
    public function setSorting(array $sorting = [])
115
    {
116 4
        $this->sorting = $sorting;
117
118 4
        return $this;
119
    }
120
121
    public function getFilters()
122
    {
123
        return $this->filtering;
124
    }
125
126
    public function getOrFilters()
127
    {
128
        return $this->orFiltering;
129
    }
130
131 1
    private function noExistsJoin($prevEntityAlias, $currentEntityAlias)
132
    {
133 1
        if (null === $this->joins) {
134 1
            $this->joins = [];
135
        }
136
137 1
        $needle = $prevEntityAlias . "_" . $currentEntityAlias;
138
139 1
        return !in_array($needle, $this->joins);
140
    }
141
142 1
    private function storeJoin($prevEntityAlias, $currentEntityAlias)
143
    {
144 1
        $needle = $prevEntityAlias . "_" . $currentEntityAlias;
145 1
        $this->joins[$needle] = $needle;
146 1
    }
147
148 1
    public function join(String $relation)
149
    {
150 1
        $relation = explode('|', $relation)[0];
151 1
        $relations = [$relation];
152
153 1
        if (strstr($relation, '_embedded.')) {
154 1
            $embeddedFields = explode('.', $relation);
155 1
            unset($embeddedFields[count($embeddedFields) - 1]);
156 1
            unset($embeddedFields[0]);
157 1
            $relations = $embeddedFields;
158
        }
159
160 1
        $entityName = $this->getEntityName();
161 1
        $entityAlias = $this->entityAlias;
162
163 1
        foreach ($relations as $relation) {
164
165 1
            $relation = $this->parser->camelize($relation);
166 1
            $relationEntityAlias = 'table_' . $relation;
167
168 1
            $metadata = $this->manager->getClassMetadata($entityName);
169
170 1
            if ($metadata->hasAssociation($relation)) {
171
172 1
                $association = $metadata->getAssociationMapping($relation);
173
174 1
                $fieldName = $this->parser->camelize($association['fieldName']);
175
176 1
                if ($this->noExistsJoin($relationEntityAlias, $relation)) {
177
178 1
                    $this->qBuilder
179 1
                            ->join($entityAlias . "." . $fieldName, $relationEntityAlias);
180
181 1
                    $this->storeJoin($relationEntityAlias, $relation);
182
                }
183 1
                $entityName = $association['targetEntity'];
184 1
                $entityAlias = $relationEntityAlias;
185
            }
186
187 1
            $this->setRelationEntityAlias($relationEntityAlias);
188
        }
189
190 1
        return $this;
191
    }
192
193 5
    public function filter()
194
    {
195 5
        $this->ensureFilteringIsDefined();
196 5
        $this->ensureFieldsDefined();
197
198 5
        foreach ($this->filtering as $filter => $value) {
199 4
            $this->applyFilterAnd($filter, $value);
200
        }
201
202 5
        if (null !== $this->orFiltering) {
203 3
            $orFilter = [];
204 3
            $orFilter['orCondition'] = null;
205 3
            $orFilter['parameters'] = [];
206
207 3
            foreach ($this->orFiltering as $filter => $value) {
208
                $orFilter = $this->applyFilterOr($filter, $value, $orFilter);
209
            }
210
211 3
            if ((count($orFilter) > 0) && ($orFilter['orCondition'] != null)) {
212
                $this->qBuilder->andWhere($orFilter['orCondition']);
213
214
                foreach ($orFilter['parameters'] as $parameter) {
215
                    $this->qBuilder->setParameter($parameter['field'], $parameter['value']);
216
                }
217
            }
218
        }
219
220 5
        return $this;
221
    }
222
223 4
    private function applyFilterAnd($filter, $value)
224
    {
225 4
        $whereCondition = null;
226 4
        $filtering = FilteringObject::fromFilter($filter);
227 4
        $fieldName = $this->parser->camelize($filtering->getFieldName());
228
229 4
        $op = Operator::fromFilteringObject($filtering);
230
231 4
        $saltObj = new Salt($this->qBuilder);
232 4
        $saltObj->generateSaltForName($fieldName);
233
234 4
        if (in_array($fieldName, $this->fields)) {
235
236 3 View Code Duplication
            if ($filtering->hasOperator()) {
0 ignored issues
show
Duplication introduced by
This code seems to be duplicated across your project.

Duplicated code is one of the most pungent code smells. If you need to duplicate the same code in three or more different places, we strongly encourage you to look into extracting the code into a single class or operation.

You can also find more detailed suggestions in the “Code” section of your repository.

Loading history...
237 3
                if ($filtering->isListOperator()) {
238
                    $whereCondition =
239
                        $this->entityAlias . '.' . $fieldName . ' ' .
240
                        $op->getMeta() . ' ' .
241
                        '(:field_' . $fieldName . $saltObj->getSalt() . ')';
242 3
                } else if ($filtering->isFieldEqualsOperator()) {
243
                    $whereCondition =
244
                        $this->entityAlias . '.' . $fieldName . ' ' .
245
                        $op->getMeta() . ' ' .
246
                        $this->entityAlias . '.' . $value;
247
                } else {
248
                    $whereCondition =
249 3
                        $this->entityAlias . '.' . $fieldName . ' ' .
250 3
                        $op->getMeta() . ' ' .
251 3
                        ':field_' . $fieldName . $saltObj->getSalt();
252
                }
253
            } else {
254
                $whereCondition =
255
                    $this->entityAlias . '.' . $fieldName . ' ' .
256
                    $op->getMeta() . ' ' .
257
                    ':field_' . $fieldName . $saltObj->getSalt();
258
            }
259
260 3
            $this->qBuilder->andWhere($whereCondition);
261
262 3 View Code Duplication
            if ($op->haveSubstitutionPattern()) {
0 ignored issues
show
Duplication introduced by
This code seems to be duplicated across your project.

Duplicated code is one of the most pungent code smells. If you need to duplicate the same code in three or more different places, we strongly encourage you to look into extracting the code into a single class or operation.

You can also find more detailed suggestions in the “Code” section of your repository.

Loading history...
263 2
                if ($filtering->isListOperator()) {
264
                    $value = explode(',', $value);
265
                } else {
266 2
                    $value = str_replace(
267 2
                        '{string}',
268 2
                        $value,
269 2
                        $op->getSubstitutionPattern()
270
                    );
271
                }
272
            }
273
274 3
            $this->qBuilder->setParameter('field_' . $fieldName . $saltObj->getSalt(), $value);
275
        } else {
276 1
            $isNotARelation = 0 !== strpos($fieldName, 'Embedded.');
277 1
            if ($isNotARelation) {
278
                if (is_array($value)) {
279
                    throw new \LogicException(
280
                        'Mmm! Value cannot be an array'
281
                    );
282
                }
283
284
                $whereCondition =
285
                    $this->entityAlias . '.' . $fieldName . ' ' .
286
                    $op->getMeta() . ' ' .
287
                    $this->entityAlias . '.' . $value;
288
                $this->qBuilder->andWhere($whereCondition);
289
            }
290
        }
291
292 4
        if (strstr($filter, '_embedded.')) {
293
294 1
            $this->join($filter);
295 1
            $relationEntityAlias = $this->getRelationEntityAlias();
296
297 1
            $embeddedFields = explode('.', $fieldName);
298 1
            $fieldName = $this->parser->camelize($embeddedFields[count($embeddedFields) - 1]);
299
300 1 View Code Duplication
            if ($filtering->isListOperator()) {
0 ignored issues
show
Duplication introduced by
This code seems to be duplicated across your project.

Duplicated code is one of the most pungent code smells. If you need to duplicate the same code in three or more different places, we strongly encourage you to look into extracting the code into a single class or operation.

You can also find more detailed suggestions in the “Code” section of your repository.

Loading history...
301
                $whereCondition =
302
                    $relationEntityAlias . '.' . $fieldName . ' ' .
303
                    $op->getMeta() . ' ' .
304
                    '(:field_' . $fieldName . $saltObj->getSalt() . ')';
305
            } else {
306
                $whereCondition =
307 1
                    $relationEntityAlias . '.' . $fieldName . ' ' .
308 1
                    $op->getMeta() . ' ' .
309 1
                    ':field_' . $fieldName . $saltObj->getSalt();
310
            }
311
312 1
            $this->qBuilder->andWhere($whereCondition);
313 1 View Code Duplication
            if ($op->haveSubstitutionPattern()) {
0 ignored issues
show
Duplication introduced by
This code seems to be duplicated across your project.

Duplicated code is one of the most pungent code smells. If you need to duplicate the same code in three or more different places, we strongly encourage you to look into extracting the code into a single class or operation.

You can also find more detailed suggestions in the “Code” section of your repository.

Loading history...
314 1
                if ($filtering->isListOperator()) {
315
                    $value = explode(',', $value);
0 ignored issues
show
Bug introduced by
It seems like $value can also be of type array; however, parameter $string of explode() does only seem to accept string, maybe add an additional type check? ( Ignorable by Annotation )

If this is a false-positive, you can also ignore this issue in your code via the ignore-type  annotation

315
                    $value = explode(',', /** @scrutinizer ignore-type */ $value);
Loading history...
316
                } else {
317 1
                    $value = str_replace(
318 1
                        '{string}',
319 1
                        $value,
320 1
                        $op->getSubstitutionPattern()
321
                    );
322
                }
323
            }
324
325 1
            $this->qBuilder->setParameter('field_' . $fieldName . $saltObj->getSalt(), $value);
326
        }
327 4
    }
328
329
    private function applyFilterOr($filter, $value, $orCondition)
330
    {
331
        $whereCondition = null;
332
        $filtering = FilteringObject::fromFilter($filter);
333
334
        $fieldName = $this->parser->camelize($filtering->getFieldName());
335
336
        $op = Operator::fromFilteringObject($filtering);
337
338
        $saltObj = new Salt($this->qBuilder);
339
        $saltObj->generateSaltForName($fieldName);
340
341
        if (in_array($fieldName, $this->fields)) {
342
343 View Code Duplication
            if ($filtering->hasOperator()) {
0 ignored issues
show
Duplication introduced by
This code seems to be duplicated across your project.

Duplicated code is one of the most pungent code smells. If you need to duplicate the same code in three or more different places, we strongly encourage you to look into extracting the code into a single class or operation.

You can also find more detailed suggestions in the “Code” section of your repository.

Loading history...
344
                if ($filtering->isListOperator()) {
345
                    $whereCondition =
346
                        $this->entityAlias . '.' . $fieldName . ' ' .
347
                        $op->getMeta()
348
                        .' (:field_' . $fieldName . $saltObj->getSalt() . ')';
349
                } else if ($filtering->isFieldEqualsOperator()) {
350
                    $whereCondition =
351
                        $this->entityAlias . '.' . $fieldName . ' ' .
352
                        $op->getMeta() . ' ' .
353
                        $this->entityAlias . '.' . $value
354
                    ;
355
                } else {
356
                    $whereCondition =
357
                        $this->entityAlias . '.' . $fieldName . ' ' .
358
                        $op->getMeta() . ' ' .
359
                        ':field_' . $fieldName . $saltObj->getSalt();
360
                }
361
            } else {
362
                $whereCondition =
363
                    $this->entityAlias . '.' . $fieldName . ' ' .
364
                    '=' . ' ' .
365
                    ':field_' . $fieldName . $saltObj->getSalt();
366
            }
367
368 View Code Duplication
            if ($orCondition['orCondition'] != null) {
0 ignored issues
show
Duplication introduced by
This code seems to be duplicated across your project.

Duplicated code is one of the most pungent code smells. If you need to duplicate the same code in three or more different places, we strongly encourage you to look into extracting the code into a single class or operation.

You can also find more detailed suggestions in the “Code” section of your repository.

Loading history...
369
                $orCondition['orCondition'] .= ' OR ' . $whereCondition;
370
            } else {
371
                $orCondition['orCondition'] = $whereCondition;
372
            }
373
374 View Code Duplication
            if ($op->haveSubstitutionPattern()) {
0 ignored issues
show
Duplication introduced by
This code seems to be duplicated across your project.

Duplicated code is one of the most pungent code smells. If you need to duplicate the same code in three or more different places, we strongly encourage you to look into extracting the code into a single class or operation.

You can also find more detailed suggestions in the “Code” section of your repository.

Loading history...
375
                if ($filtering->isListOperator()) {
376
                    $value = explode(',', $value);
377
                } else {
378
                    $value = str_replace(
379
                        '{string}',
380
                        $value,
381
                        $op->getSubstitutionPattern()
382
                    );
383
                }
384
            }
385
386
            $orCondition['parameters'][] = [
387
                'field' => 'field_' . $fieldName . $salt,
0 ignored issues
show
Comprehensibility Best Practice introduced by
The variable $salt does not exist. Did you maybe mean $saltObj?
Loading history...
388
                'value' => $value
389
            ];
390
        } else {
391
            $isNotARelation = 0 !== strpos($fieldName, 'Embedded.');
392
            if ($isNotARelation) {
393
                $whereCondition =
394
                    $this->entityAlias . '.' . $fieldName . ' ' .
395
                    $op->getMeta() . ' ' .
396
                    $this->entityAlias . '.' . $value;
397 View Code Duplication
                if ($orCondition['orCondition'] != null) {
0 ignored issues
show
Duplication introduced by
This code seems to be duplicated across your project.

Duplicated code is one of the most pungent code smells. If you need to duplicate the same code in three or more different places, we strongly encourage you to look into extracting the code into a single class or operation.

You can also find more detailed suggestions in the “Code” section of your repository.

Loading history...
398
                    $orCondition['orCondition'] .= ' OR ' . $whereCondition;
399
                } else {
400
                    $orCondition['orCondition'] = $whereCondition;
401
                }
402
            }
403
        }
404
405
        if (strstr($filter, '_embedded.')) {
406
407
            $this->join($filter);
408
            $relationEntityAlias = $this->getRelationEntityAlias();
409
410
            $embeddedFields = explode('.', $fieldName);
411
            $fieldName = $this->parser->camelize($embeddedFields[count($embeddedFields) - 1]);
412
413 View Code Duplication
            if ($filtering->isListOperator()) {
0 ignored issues
show
Duplication introduced by
This code seems to be duplicated across your project.

Duplicated code is one of the most pungent code smells. If you need to duplicate the same code in three or more different places, we strongly encourage you to look into extracting the code into a single class or operation.

You can also find more detailed suggestions in the “Code” section of your repository.

Loading history...
414
                $whereCondition =
415
                    $relationEntityAlias . '.' . $fieldName . ' ' .
416
                    $op->getMeta() . ' ' .
417
                    '(:field_' . $fieldName . $saltObj->getSalt() . ')';
418
            } else {
419
                $whereCondition =
420
                    $relationEntityAlias . '.' . $fieldName . ' ' .
421
                    $op->getMeta() . ' ' .
422
                    ':field_' . $fieldName . $saltObj->getSalt();
423
            }
424
425 View Code Duplication
            if ($orCondition['orCondition'] != null) {
0 ignored issues
show
Duplication introduced by
This code seems to be duplicated across your project.

Duplicated code is one of the most pungent code smells. If you need to duplicate the same code in three or more different places, we strongly encourage you to look into extracting the code into a single class or operation.

You can also find more detailed suggestions in the “Code” section of your repository.

Loading history...
426
                $orCondition['orCondition'] .= ' OR ' . $whereCondition;
427
            } else {
428
                $orCondition['orCondition'] = $whereCondition;
429
            }
430
431 View Code Duplication
            if ($op->haveSubstitutionPattern()) {
0 ignored issues
show
Duplication introduced by
This code seems to be duplicated across your project.

Duplicated code is one of the most pungent code smells. If you need to duplicate the same code in three or more different places, we strongly encourage you to look into extracting the code into a single class or operation.

You can also find more detailed suggestions in the “Code” section of your repository.

Loading history...
432
                if ($filtering->isListOperator()) {
433
                    $value = explode(',', $value);
0 ignored issues
show
Bug introduced by
It seems like $value can also be of type array; however, parameter $string of explode() does only seem to accept string, maybe add an additional type check? ( Ignorable by Annotation )

If this is a false-positive, you can also ignore this issue in your code via the ignore-type  annotation

433
                    $value = explode(',', /** @scrutinizer ignore-type */ $value);
Loading history...
434
                } else {
435
                    $value = str_replace(
436
                        '{string}',
437
                        $value,
438
                        $op->getSubstitutionPattern()
439
                    );
440
                }
441
            }
442
443
            $orCondition['parameters'][] = [
444
                'field' => 'field_' . $fieldName . $saltObj->getSalt(),
445
                'value' => $value
446
            ];
447
        }
448
449
        return $orCondition;
450
    }
451
452 3
    public function sort()
453
    {
454 3
        $this->ensureFieldsDefined();
455 3
        $this->ensureSortingIsDefined();
456
457 3
        foreach ($this->sorting as $sort => $val) {
458
            $val = strtolower($val);
459
460
            $fieldName = $this->parser->camelize($sort);
461
462
            if (in_array($fieldName, $this->fields)) {
463
                $direction = ($val === self::DIRECTION_AZ) ? self::DIRECTION_AZ : self::DIRECTION_ZA;
464
                $this->qBuilder->addOrderBy($this->entityAlias . '.' . $fieldName, $direction);
465
            }
466
467
            if (strstr($sort, '_embedded.')) {
468
                $this->join($sort);
469
                $relationEntityAlias = $this->getRelationEntityAlias();
470
471
                $embeddedFields = explode('.', $sort);
472
                $fieldName = $this->parser->camelize($embeddedFields[2]);
473
                $direction = ($val === self::DIRECTION_AZ) ? self::DIRECTION_AZ : self::DIRECTION_ZA;
474
475
                $this->qBuilder->addOrderBy($relationEntityAlias . '.' . $fieldName, $direction);
476
            }
477
478
        }
479
480 3
        return $this;
481
    }
482
483 6
    public function getQueryBuilder()
484
    {
485 6
        $this->ensureQueryBuilderIsDefined();
486
487 6
        return $this->qBuilder;
488
    }
489
490
    public function buildSelectValue() : string
491
    {
492
        if ("" == $this->getSelect()) {
493
            return $this->getEntityAlias(
0 ignored issues
show
Bug introduced by
The method getEntityAlias() does not exist on Mado\QueryBundle\Queries\QueryBuilderFactory. Did you maybe mean getEntityName()? ( Ignorable by Annotation )

If this is a false-positive, you can also ignore this issue in your code via the ignore-call  annotation

493
            return $this->/** @scrutinizer ignore-call */ getEntityAlias(

This check looks for calls to methods that do not seem to exist on a given type. It looks for the method on the type itself as well as in inherited classes or implemented interfaces.

This is most likely a typographical error or the method has been renamed.

Loading history...
494
                $this->getEntityName()
495
            );
496
        }
497
498
        return $this->getSelect();
499
    }
500
501 1
    private function setRelationEntityAlias(string $relationEntityAlias)
502
    {
503 1
        $this->relationEntityAlias = $relationEntityAlias;
504 1
    }
505
506 1
    private function getRelationEntityAlias()
507
    {
508 1
        return $this->relationEntityAlias;
509
    }
510
511 5
    public function setRel($rel)
512
    {
513 5
        $this->rel = $rel;
514
515 5
        return $this;
516
    }
517
518
    public function getRel()
519
    {
520
        return $this->rel;
521
    }
522
523 4
    public function setPrinting($printing)
524
    {
525 4
        $this->printing = $printing;
526
527 4
        return $this;
528
    }
529
530
    public function getPrinting()
531
    {
532
        return $this->printing;
533
    }
534
535
    public function setPage($page)
536
    {
537
        $this->page = $page;
538
539
        return $this;
540
    }
541
542
    public function getPage()
543
    {
544
        return $this->page;
545
    }
546
547
    public function setPageLength($pageLength)
548
    {
549
        $this->pageLength = $pageLength;
550
551
        return $this;
552
    }
553
554
    public function getPageLength()
555
    {
556
        return $this->pageLength;
557
    }
558
559 4
    public function setSelect( $select) : QueryBuilderFactory
560
    {
561 4
        $this->select = $select;
562
563 4
        return $this;
564
    }
565
566
    public function getSelect()
567
    {
568
        return $this->select;
569
    }
570
571
    public function getEntityManager()
572
    {
573
        return $this->manager;
574
    }
575
}
576