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
04:31 queued 01:55
created

QueryBuilderFactory::sort()   C

Complexity

Conditions 8
Paths 10

Size

Total Lines 38
Code Lines 20

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 0
CRAP Score 72

Importance

Changes 0
Metric Value
cc 8
eloc 20
nc 10
nop 0
dl 0
loc 38
ccs 0
cts 16
cp 0
crap 72
rs 5.3846
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
162
                $entityName = $association['targetEntity'];
163
                $entityAlias = $relationEntityAlias;
164
            }
165
166
            $this->setRelationEntityAlias($relationEntityAlias);
167
        }
168
169
        return $this;
170
    }
171
172
    public function filter()
173
    {
174
        if (null === $this->filtering) {
175
            throw new \RuntimeException(
176
                'Oops! Filtering is not defined'
177
            );
178
        }
179
180
        if (!$this->fields) {
181
            throw new \RuntimeException(
182
                'Oops! Fields are not defined'
183
            );
184
        }
185
186
        if ($this->configProvider) {
187
            // $userRoles = $this->configProvider->getUserRoles();
188
        }
189
190
        foreach ($this->filtering as $filter => $value) {
191
            $this->applyFilterAnd($filter, $value);
192
        }
193
194
        if (null !== $this->orFiltering) {
195
            $orFilter = [];
196
            $orFilter['orCondition'] = null;
197
            $orFilter['parameters'] = [];
198
199
            foreach ($this->orFiltering as $filter => $value) {
200
                $orFilter = $this->applyFilterOr($filter, $value, $orFilter);
201
            }
202
203
            if ((count($orFilter) > 0) && ($orFilter['orCondition'] != null)) {
204
                $this->qBuilder->andWhere($orFilter['orCondition']);
205
206
                foreach ($orFilter['parameters'] as $parameter) {
207
                    $this->qBuilder->setParameter($parameter['field'], $parameter['value']);
208
                }
209
            }
210
        }
211
212
        return $this;
213
    }
214
215
    private function applyFilterAnd($filter, $value)
216
    {
217
        $whereCondition = null;
218
        $filterAndOperator = explode('|',$filter);
219
220
        $fieldName = $filterAndOperator[0];
221
        $fieldName = $this->parser->camelize($fieldName);
222
223
        $operator = $this->getValueAvailableFilters()[self::DEFAULT_OPERATOR];
224
        if(isset($filterAndOperator[1])){
225
            $operator = $this->getValueAvailableFilters()[$filterAndOperator[1]];
226
        }
227
228
        // controllo se il filtro che mi arriva dalla richiesta è una proprietà di questa entità
229
        // esempio per users: filtering[username|contains]=mado
230
        if (in_array($fieldName, $this->fields)) {
231
232
            $salt = '';
233 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...
234
                if ($parameter->getName() == 'field_' . $fieldName) {
235
                    $salt = '_' . rand(111, 999);
236
                }
237
            }
238
239
            // filtering[foo|bar]
240
            // $filterAndOperator[0] = 'foo'
241
            // $filterAndOperator[1] = 'bar'
242 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...
243
                if ('list' == $filterAndOperator[1]) {
244
                    $whereCondition = $this->entityAlias.'.'.$fieldName.' '.$operator['meta'].' (:field_'.$fieldName . $salt . ')';
245
                } else if ('field_eq' == $filterAndOperator[1]) {
246
                    $whereCondition =
247
                        $this->entityAlias . '.' . $fieldName . ' '.
248
                        $operator['meta'] . '' .
249
                        $this->entityAlias . '.' . $value
250
                        ;
251
                    //} else {
252
                    //throw new \RuntimeException(
253
                    //'Oops! Eccezzione'
254
                    //);
255
                } else {
256
                    $whereCondition = $this->entityAlias.'.'.$fieldName.' '.$operator['meta'].' :field_'.$fieldName . $salt;
257
                }
258
            } else {
259
                $whereCondition = $this->entityAlias.'.'.$fieldName.' = :field_'.$fieldName . $salt;
260
            }
261
262
            $this->qBuilder->andWhere($whereCondition);
263
264 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...
265
                if (isset($filterAndOperator[1]) && 'list' == $filterAndOperator[1]) {
266
                    $value = explode(',', $value);
267
                } else {
268
                    $value = str_replace(
269
                        '{string}',
270
                        $value,
271
                        $operator['substitution_pattern']
272
                    );
273
                }
274
            }
275
276
            $this->qBuilder->setParameter('field_' . $fieldName . $salt, $value);
277
        } else {
278
            $isNotARelation = 0 !== strpos($fieldName, 'Embedded.');
279
            if ($isNotARelation) {
280
                $whereCondition = $this->entityAlias.'.'.$fieldName.' '.$operator['meta'].' ' . $this->entityAlias . '.' . $value;
281
                $this->qBuilder->andWhere($whereCondition);
282
            }
283
        }
284
285
        // controllo se il filtro si riferisce ad una relazione dell'entità quindi devo fare dei join
286
        // esempio per users: filtering[_embedded.groups.name|eq]=admin
287
        if (strstr($filter, '_embedded.')) {
288
289
            $this->join($filter);
290
            $relationEntityAlias = $this->getRelationEntityAlias();
291
292
            $embeddedFields = explode('.', $fieldName);
293
            $fieldName = $this->parser->camelize($embeddedFields[count($embeddedFields)-1]);
294
295
            $salt = '';
296 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...
297
                if ($parameter->getName() == 'field_' . $fieldName) {
298
                    $salt = '_' . rand(111, 999);
299
                }
300
            }
301
302 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...
303
                $whereCondition = $relationEntityAlias.'.'.$fieldName.' '.$operator['meta'].' (:field_'.$fieldName . $salt . ')';
304
            } else {
305
                $whereCondition = $relationEntityAlias.'.'.$fieldName.' '.$operator['meta'].' :field_'.$fieldName . $salt;
306
            }
307
308
            $this->qBuilder->andWhere($whereCondition);
309 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...
310
                if (isset($filterAndOperator[1]) && 'list' == $filterAndOperator[1]) {
311
                    $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

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

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

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