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 (#61)
by Simone
02:08
created

QueryBuilderFactory::setPageLength()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 5
Code Lines 2

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 0
CRAP Score 2

Importance

Changes 0
Metric Value
cc 1
eloc 2
nc 1
nop 1
dl 0
loc 5
ccs 0
cts 0
cp 0
crap 2
rs 9.4285
c 0
b 0
f 0
1
<?php
2
3
namespace Mado\QueryBundle\Queries;
4
5
use Doctrine\ORM\QueryBuilder;
6
use Mado\QueryBundle\Dictionary\Operators;
7
use Mado\QueryBundle\Services\ConfigProvider;
8
9
class QueryBuilderFactory extends AbstractQuery
10
{
11
    const DIRECTION_AZ = 'asc';
12
13
    const DIRECTION_ZA = 'desc';
14
15
    const DEFAULT_OPERATOR = 'eq';
16
17
    protected $qBuilder;
18
19
    protected $fields;
20
21
    protected $filtering;
22
23
    protected $orFiltering;
24
25
    protected $relationEntityAlias;
26
27
    protected $sorting;
28
29
    protected $joins;
30
31
    protected $rel;
32
33
    protected $printing;
34
35
    protected $page;
36
37
    protected $pageLength;
38
39
    protected $select;
40
41
    protected $configProvider;
42
43
    public function getAvailableFilters()
44
    {
45
        return array_keys($this->getValueAvailableFilters());
46
    }
47
48
    public function getValueAvailableFilters()
49
    {
50
        return Operators::getOperators();
51
    }
52
53
    public function setFields(array $fields = [])
54
    {
55
        $this->fields = $fields;
56
57
        return $this;
58
    }
59
60
    public function getFields()
61
    {
62
        if (null === $this->fields) {
63
            throw new \RuntimeException(
64
                'Oops! Fields are not defined'
65
            );
66
        }
67
68
        return $this->fields;
69
    }
70
71
    public function setFilters(array $filtering = [])
72
    {
73
        $this->filtering = $filtering;
74
75
        return $this;
76 1
    }
77
78 1
    public function setOrFilters(array $orFiltering = [])
79
    {
80
        $this->orFiltering = $orFiltering;
81
82
        return $this;
83
    }
84
85
    public function setSorting(array $sorting = [])
86
    {
87
        $this->sorting = $sorting;
88
89
        return $this;
90
    }
91
92
    public function getFilters()
93
    {
94
        return $this->filtering;
95
    }
96
97
    public function getOrFilters()
98
    {
99
        return $this->orFiltering;
100
    }
101
102
    private function noExistsJoin($prevEntityAlias, $currentEntityAlias)
103
    {
104
        if (null === $this->joins) {
105
            $this->joins = [];
106
        }
107
108
        $needle = $prevEntityAlias . "_" . $currentEntityAlias;
109
110
        return ! in_array($needle, $this->joins);
111
    }
112
113
    private function storeJoin($prevEntityAlias, $currentEntityAlias)
114
    {
115
        $needle = $prevEntityAlias . "_" . $currentEntityAlias;
116
        $this->joins[$needle] = $needle;
117
    }
118
119
    /**
120
     * @param String $relation Nome della relazione semplice (groups.name) o con embedded (_embedded.groups.name)
121
     * @return $this
122
     */
123
    public function join(String $relation)
124
    {
125
        $relation = explode('|', $relation)[0];
126
        $relations = [$relation];
127
128
        if (strstr($relation, '_embedded.')) {
129
            $embeddedFields = explode('.', $relation);
130
            $relation = $this->parser->camelize($embeddedFields[1]);
0 ignored issues
show
Unused Code introduced by
The assignment to $relation is dead and can be removed.
Loading history...
131
132
            // elimino l'ultimo elemento che dovrebbe essere il nome del campo
133
            unset($embeddedFields[count($embeddedFields) - 1]);
134
135
            // elimino il primo elemento _embedded
136
            unset($embeddedFields[0]);
137
138
            $relations = $embeddedFields;
139
        }
140
141
        $entityName = $this->getEntityName();
142
        $entityAlias = $this->entityAlias;
143
144
        foreach ($relations as $relation) {
145
146
            $relation = $this->parser->camelize($relation);
147
            $relationEntityAlias = 'table_' . $relation;
148
149
            $metadata = $this->manager->getClassMetadata($entityName);
150
151
            if ($metadata->hasAssociation($relation)) {
152
153
                $association = $metadata->getAssociationMapping($relation);
154
155
                $fieldName = $this->parser->camelize($association['fieldName']);
156
157
                if ($this->noExistsJoin($relationEntityAlias, $relation)) {
158
                    $this->qBuilder->join($entityAlias . "." . $fieldName, $relationEntityAlias);
159
                    $this->storeJoin($relationEntityAlias, $relation);
160
                }
161
                $entityName = $association['targetEntity'];
162
                $entityAlias = $relationEntityAlias;
163
            }
164
165
            $this->setRelationEntityAlias($relationEntityAlias);
166
        }
167
168
        return $this;
169
    }
170
171
    public function filter()
172
    {
173
        if (null === $this->filtering) {
174
            throw new \RuntimeException(
175
                'Oops! Filtering is not defined'
176
            );
177
        }
178
179
        if (!$this->fields) {
180
            throw new \RuntimeException(
181
                'Oops! Fields are not defined'
182
            );
183
        }
184
185
        if ($this->configProvider) {
186
            // $userRoles = $this->configProvider->getUserRoles();
187
        }
188
189
        foreach ($this->filtering as $filter => $value) {
190
            $this->applyFilterAnd($filter, $value);
191
        }
192
193
        if (null !== $this->orFiltering) {
194
            $orFilter = [];
195
            $orFilter['orCondition'] = null;
196
            $orFilter['parameters'] = [];
197
198
            foreach ($this->orFiltering as $filter => $value) {
199
                $orFilter = $this->applyFilterOr($filter, $value, $orFilter);
200
            }
201
202
            if ((count($orFilter) > 0) && ($orFilter['orCondition'] != null)) {
203
                $this->qBuilder->andWhere($orFilter['orCondition']);
204
205
                foreach ($orFilter['parameters'] as $parameter) {
206
                    $this->qBuilder->setParameter($parameter['field'], $parameter['value']);
207
                }
208
            }
209
        }
210
211
        return $this;
212
    }
213
214
    private function applyFilterAnd($filter, $value)
215
    {
216
        $whereCondition = null;
217
        $filterAndOperator = explode('|',$filter);
218
219
        $fieldName = $filterAndOperator[0];
220
        $fieldName = $this->parser->camelize($fieldName);
221
222
        $operator = $this->getValueAvailableFilters()[self::DEFAULT_OPERATOR];
223
        if(isset($filterAndOperator[1])){
224
            $operator = $this->getValueAvailableFilters()[$filterAndOperator[1]];
225
        }
226
227
        // controllo se il filtro che mi arriva dalla richiesta è una proprietà di questa entità
228
        // esempio per users: filtering[username|contains]=mado
229
        if (in_array($fieldName, $this->fields)) {
230
231
            $salt = '';
232 View Code Duplication
            foreach ($this->qBuilder->getParameters() as $parameter) {
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...
233
                if ($parameter->getName() == 'field_' . $fieldName) {
234
                    $salt = '_' . rand(111, 999);
235
                }
236
            }
237
238
            // filtering[foo|bar]
239
            // $filterAndOperator[0] = 'foo'
240
            // $filterAndOperator[1] = 'bar'
241 View Code Duplication
            if (isset($filterAndOperator[1])) {
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...
242
                if ('list' == $filterAndOperator[1]) {
243
                    $whereCondition = $this->entityAlias.'.'.$fieldName.' '.$operator['meta'].' (:field_'.$fieldName . $salt . ')';
244
                } else if ('field_eq' == $filterAndOperator[1]) {
245
                    $whereCondition =
246
                        $this->entityAlias . '.' . $fieldName . ' '.
247
                        $operator['meta'] . '' .
248
                        $this->entityAlias . '.' . $value
249
                        ;
250
                    //} else {
251
                    //throw new \RuntimeException(
252
                    //'Oops! Eccezzione'
253
                    //);
254
                } else {
255
                    $whereCondition = $this->entityAlias.'.'.$fieldName.' '.$operator['meta'].' :field_'.$fieldName . $salt;
256
                }
257
            } else {
258
                $whereCondition = $this->entityAlias.'.'.$fieldName.' = :field_'.$fieldName . $salt;
259
            }
260
261
            $this->qBuilder->andWhere($whereCondition);
262
263 View Code Duplication
            if (isset($operator['substitution_pattern'])) {
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...
264
                if (isset($filterAndOperator[1]) && 'list' == $filterAndOperator[1]) {
265
                    $value = explode(',', $value);
266
                } else {
267
                    $value = str_replace(
268
                        '{string}',
269
                        $value,
270
                        $operator['substitution_pattern']
271
                    );
272
                }
273
            }
274
275
            $this->qBuilder->setParameter('field_' . $fieldName . $salt, $value);
276
        } else {
277
            $isNotARelation = 0 !== strpos($fieldName, 'Embedded.');
278
            if ($isNotARelation) {
279
                $whereCondition = $this->entityAlias.'.'.$fieldName.' '.$operator['meta'].' ' . $this->entityAlias . '.' . $value;
280
                $this->qBuilder->andWhere($whereCondition);
281
            }
282
        }
283
284
        // controllo se il filtro si riferisce ad una relazione dell'entità quindi devo fare dei join
285
        // esempio per users: filtering[_embedded.groups.name|eq]=admin
286
        if (strstr($filter, '_embedded.')) {
287
288
            $this->join($filter);
289
            $relationEntityAlias = $this->getRelationEntityAlias();
290
291
            $embeddedFields = explode('.', $fieldName);
292
            $fieldName = $this->parser->camelize($embeddedFields[count($embeddedFields)-1]);
293
294
            $salt = '';
295 View Code Duplication
            foreach ($this->qBuilder->getParameters() as $parameter) {
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...
296
                if ($parameter->getName() == 'field_' . $fieldName) {
297
                    $salt = '_' . rand(111, 999);
298
                }
299
            }
300
301 View Code Duplication
            if (isset($filterAndOperator[1]) && 'list' == $filterAndOperator[1]) {
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...
302
                $whereCondition = $relationEntityAlias.'.'.$fieldName.' '.$operator['meta'].' (:field_'.$fieldName . $salt . ')';
303
            } else {
304
                $whereCondition = $relationEntityAlias.'.'.$fieldName.' '.$operator['meta'].' :field_'.$fieldName . $salt;
305
            }
306
307
            $this->qBuilder->andWhere($whereCondition);
308 View Code Duplication
            if (isset($operator['substitution_pattern'])) {
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...
309
                if (isset($filterAndOperator[1]) && 'list' == $filterAndOperator[1]) {
310
                    $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

310
                    $value = explode(',', /** @scrutinizer ignore-type */ $value);
Loading history...
311
                } else {
312
                    $value = str_replace(
313
                        '{string}',
314
                        $value,
315
                        $operator['substitution_pattern']
316
                    );
317
                }
318
            }
319
320
            $this->qBuilder->setParameter('field_' . $fieldName . $salt, $value);
321
        }
322
    }
323
324
    private function applyFilterOr($filter, $value, $orCondition)
325
    {
326
        $whereCondition = null;
327
        $filterAndOperator = explode('|',$filter);
328
329
        $fieldName = $filterAndOperator[0];
330
        $fieldName = $this->parser->camelize($fieldName);
331
332
        $operator = $this->getValueAvailableFilters()[self::DEFAULT_OPERATOR];
333
        if(isset($filterAndOperator[1])){
334
            $operator = $this->getValueAvailableFilters()[$filterAndOperator[1]];
335
        }
336
337
        // controllo se il filtro che mi arriva dalla richiesta è una proprietà di questa entità
338
        // esempio per users: filtering[username|contains]=mado
339
        if (in_array($fieldName, $this->fields)) {
340
341
            $salt = '';
342 View Code Duplication
            foreach ($this->qBuilder->getParameters() as $parameter) {
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...
343
                if ($parameter->getName() == 'field_' . $fieldName) {
344
                    $salt = '_' . rand(111, 999);
345
                }
346
            }
347
348
            if ($salt == '') {
349
                $salt = '_' . rand(111, 999);
350
            }
351
352
            // filtering[foo|bar]
353
            // $filterAndOperator[0] = 'foo'
354
            // $filterAndOperator[1] = 'bar'
355 View Code Duplication
            if (isset($filterAndOperator[1])) {
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...
356
                if ('list' == $filterAndOperator[1]) {
357
                    $whereCondition = $this->entityAlias.'.'.$fieldName.' '.$operator['meta'].' (:field_'.$fieldName . $salt . ')';
358
                } else if ('field_eq' == $filterAndOperator[1]) {
359
                    $whereCondition =
360
                        $this->entityAlias . '.' . $fieldName . ' '.
361
                        $operator['meta'] . '' .
362
                        $this->entityAlias . '.' . $value
363
                    ;
364
                    //} else {
365
                    //throw new \RuntimeException(
366
                    //'Oops! Eccezzione'
367
                    //);
368
                } else {
369
                    $whereCondition = $this->entityAlias.'.'.$fieldName.' '.$operator['meta'].' :field_'.$fieldName . $salt;
370
                }
371
            } else {
372
                $whereCondition = $this->entityAlias.'.'.$fieldName.' = :field_'.$fieldName . $salt;
373
            }
374
375 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...
376
                $orCondition['orCondition'] .= ' OR ' . $whereCondition;
377
            } else {
378
                $orCondition['orCondition'] = $whereCondition;
379
            }
380
381 View Code Duplication
            if (isset($operator['substitution_pattern'])) {
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...
382
                if (isset($filterAndOperator[1]) && 'list' == $filterAndOperator[1]) {
383
                    $value = explode(',', $value);
384
                } else {
385
                    $value = str_replace(
386
                        '{string}',
387
                        $value,
388
                        $operator['substitution_pattern']
389
                    );
390
                }
391
            }
392
393
            $orCondition['parameters'][] = [
394
                'field' => 'field_' . $fieldName . $salt,
395
                'value' => $value
396
            ];
397
        } else {
398
            $isNotARelation = 0 !== strpos($fieldName, 'Embedded.');
399
            if ($isNotARelation) {
400
                $whereCondition = $this->entityAlias.'.'.$fieldName.' '.$operator['meta'].' ' . $this->entityAlias . '.' . $value;
401 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...
402
                    $orCondition['orCondition'] .= ' OR ' . $whereCondition;
403
                } else {
404
                    $orCondition['orCondition'] = $whereCondition;
405
                }
406
            }
407
        }
408
409
        // controllo se il filtro si riferisce ad una relazione dell'entità quindi devo fare dei join
410
        // esempio per users: filtering[_embedded.groups.name|eq]=admin
411
        if (strstr($filter, '_embedded.')) {
412
413
            $this->join($filter);
414
            $relationEntityAlias = $this->getRelationEntityAlias();
415
416
            $embeddedFields = explode('.', $fieldName);
417
            $fieldName = $this->parser->camelize($embeddedFields[count($embeddedFields)-1]);
418
419
            $salt = '';
420 View Code Duplication
            foreach ($this->qBuilder->getParameters() as $parameter) {
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...
421
                if ($parameter->getName() == 'field_' . $fieldName) {
422
                    $salt = '_' . rand(111, 999);
423
                }
424
            }
425
426
            if ($salt == '') {
427
                $salt = '_' . rand(111, 999);
428
            }
429
430 View Code Duplication
            if (isset($filterAndOperator[1]) && 'list' == $filterAndOperator[1]) {
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...
431
                $whereCondition = $relationEntityAlias.'.'.$fieldName.' '.$operator['meta'].' (:field_'.$fieldName . $salt . ')';
432
            } else {
433
                $whereCondition = $relationEntityAlias.'.'.$fieldName.' '.$operator['meta'].' :field_'.$fieldName . $salt;
434
            }
435
436 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...
437
                $orCondition['orCondition'] .= ' OR ' . $whereCondition;
438
            } else {
439
                $orCondition['orCondition'] = $whereCondition;
440
            }
441
442 View Code Duplication
            if (isset($operator['substitution_pattern'])) {
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...
443
                if (isset($filterAndOperator[1]) && 'list' == $filterAndOperator[1]) {
444
                    $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

444
                    $value = explode(',', /** @scrutinizer ignore-type */ $value);
Loading history...
445
                } else {
446
                    $value = str_replace(
447
                        '{string}',
448
                        $value,
449
                        $operator['substitution_pattern']
450
                    );
451
                }
452
            }
453
454
            $orCondition['parameters'][] = [
455
                'field' => 'field_' . $fieldName . $salt,
456
                'value' => $value
457
            ];
458
        }
459
460
        return $orCondition;
461
    }
462
463
    public function sort()
464
    {
465
        if (!$this->fields) {
466
            throw new \RuntimeException(
467
                'Oops! Fields are not defined'
468
            );
469
        }
470
471
        if (null === $this->sorting) {
472
            throw new \RuntimeException(
473
                'Oops! Sorting is not defined'
474
            );
475
        }
476
477
        foreach ($this->sorting as $sort => $val) {
478
            $val = strtolower($val);
479
480
            $fieldName = $this->parser->camelize($sort);
481
482
            if (in_array($fieldName, $this->fields)) {
483
                $direction = ($val === self::DIRECTION_AZ) ? self::DIRECTION_AZ : self::DIRECTION_ZA;
484
                $this->qBuilder->addOrderBy($this->entityAlias .'.'. $fieldName, $direction);
485
            }
486
487
            if (strstr($sort, '_embedded.')) {
488
                $this->join($sort);
489
                $relationEntityAlias = $this->getRelationEntityAlias();
490
491
                $embeddedFields = explode('.', $sort);
492
                $fieldName = $this->parser->camelize($embeddedFields[2]);
493
                $direction = ($val === self::DIRECTION_AZ) ? self::DIRECTION_AZ : self::DIRECTION_ZA;
494
495
                $this->qBuilder->addOrderBy($relationEntityAlias.'.'.$fieldName, $direction);
496
            }
497
498
        }
499
500
        return $this;
501
    }
502
503
    public function getQueryBuilder()
504
    {
505
        if (!$this->qBuilder) {
506
            throw new \RuntimeException(
507
                "Oops! Query builder was never initialized! call ::createQueryBuilder('entityName', 'alias') to start."
508
            );
509
        }
510
511
        return $this->qBuilder;
512
    }
513
514
    public function buildSelectValue() : string
515
    {
516
        if ("" == $this->getSelect()) {
517
            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

517
            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...
518
                $this->getEntityName()
519
            );
520
        }
521
522
        return $this->getSelect();
523
    }
524
525
    private function setRelationEntityAlias(string $relationEntityAlias)
526
    {
527
        $this->relationEntityAlias = $relationEntityAlias;
528
    }
529
530
    private function getRelationEntityAlias()
531
    {
532
        return $this->relationEntityAlias;
533
    }
534
535
    public function setRel($rel)
536
    {
537
        $this->rel = $rel;
538
539
        return $this;
540
    }
541
542
    public function getRel()
543
    {
544
        return $this->rel;
545
    }
546
547
    public function setPrinting($printing)
548
    {
549
        $this->printing = $printing;
550
551
        return $this;
552
    }
553
554
    public function getPrinting()
555
    {
556
        return $this->printing;
557
    }
558
559
    public function setPage($page)
560
    {
561
        $this->page = $page;
562
563
        return $this;
564
    }
565
566
    public function getPage()
567
    {
568
        return $this->page;
569
    }
570
571
    public function setPageLength($pageLength)
572
    {
573
        $this->pageLength = $pageLength;
574
575
        return $this;
576
    }
577
578
    public function getPageLength()
579
    {
580
        return $this->pageLength;
581
    }
582
583
    public function setSelect( $select) : QueryBuilderFactory
584
    {
585
        $this->select = $select;
586
587
        return $this;
588
    }
589
590
    public function getSelect()
591
    {
592
        return $this->select;
593
    }
594
595
    public function getEntityManager()
596
    {
597
        return $this->manager;
598
    }
599
600
    public function setConfigProvider(ConfigProvider $configProvider)
601
    {
602
        $this->configProvider = $configProvider;
603
    }
604
}
605