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 (#35)
by Simone
01:58
created

QueryBuilderFactory::sort()   B

Complexity

Conditions 6
Paths 10

Size

Total Lines 29
Code Lines 16

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 0
CRAP Score 42

Importance

Changes 0
Metric Value
cc 6
eloc 16
nc 10
nop 0
dl 0
loc 29
ccs 0
cts 17
cp 0
crap 42
rs 8.439
c 0
b 0
f 0
1
<?php
2
3
namespace Mado\QueryBundle\Queries;
4
5
use Mado\QueryBundle\Objects\FilteringObject;
6
use Mado\QueryBundle\Vocabulary\Operators;
7
8
class QueryBuilderFactory extends AbstractQuery
9
{
10
    const DIRECTION_AZ = 'asc';
11
12
    const DIRECTION_ZA = 'desc';
13
14
    /**
15
     * @var QueryBuilder
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
    private function ensureFieldsDefined()
42
    {
43
        if (!$this->fields) {
44
            throw new \RuntimeException(
45
                'Oops! Fields are not defined'
46
            );
47
        }
48
    }
49
50
    private function ensureSortingIsDefined()
51
    {
52
        if (null === $this->sorting) {
53
            throw new \RuntimeException(
54
                'Oops! Sorting is not defined'
55
            );
56
        }
57
    }
58
59
    private function ensureFilteringIsDefined()
60
    {
61
        if (null === $this->filtering) {
62
            throw new \RuntimeException(
63
                'Oops! Filtering is not defined'
64
            );
65
        }
66
    }
67
68
    private function ensureQueryBuilderIsDefined()
69
    {
70
        if (!$this->qBuilder) {
71
            throw new \RuntimeException(
72
                "Oops! Query builder was never initialized! call ::createQueryBuilder('entityName', 'alias') to start."
73
            );
74
        }
75
    }
76
77
    public function getAvailableFilters()
78
    {
79
        return array_keys(Operators::getAll());
80
    }
81
82
    public function setFields(array $fields = [])
83
    {
84
        $this->fields = $fields;
85
86
        return $this;
87
    }
88
89
    public function getFields()
90
    {
91
        $this->ensureFieldsDefined();
92
93
        return $this->fields;
94
    }
95
96
    public function setFilters(array $filtering = [])
97
    {
98
        $this->filtering = $filtering;
99
100
        return $this;
101
    }
102
103
    public function setOrFilters(array $orFiltering = [])
104
    {
105
        $this->orFiltering = $orFiltering;
106
107
        return $this;
108
    }
109
110
    public function setSorting(array $sorting = [])
111
    {
112
        $this->sorting = $sorting;
113
114
        return $this;
115
    }
116
117
    public function getFilters()
118
    {
119
        return $this->filtering;
120
    }
121
122
    public function getOrFilters()
123
    {
124
        return $this->orFiltering;
125
    }
126
127
    private function noExistsJoin($prevEntityAlias, $currentEntityAlias)
128
    {
129
        if (null === $this->joins) {
130
            $this->joins = [];
131
        }
132
133
        $needle = $prevEntityAlias . "_" . $currentEntityAlias;
134
135
        return ! in_array($needle, $this->joins);
136
    }
137
138
    private function storeJoin($prevEntityAlias, $currentEntityAlias)
139
    {
140
        $needle = $prevEntityAlias . "_" . $currentEntityAlias;
141
        $this->joins[$needle] = $needle;
142
    }
143
144
    /**
145
     * @param String $relation Nome della relazione semplice (groups.name) o con embedded (_embedded.groups.name)
146
     * @return $this
147
     */
148
    public function join(String $relation)
149
    {
150
        $relation = explode('|', $relation)[0];
151
        $relations = [$relation];
152
153
        if (strstr($relation, '_embedded.')) {
154
            $embeddedFields = explode('.', $relation);
155
156
            // elimino l'ultimo elemento che dovrebbe essere il nome del campo
157
            unset($embeddedFields[count($embeddedFields) - 1]);
158
159
            // elimino il primo elemento _embedded
160
            unset($embeddedFields[0]);
161
162
            $relations = $embeddedFields;
163
        }
164
165
        $entityName = $this->getEntityName();
166
        $entityAlias = $this->entityAlias;
167
168
        foreach ($relations as $relation) {
169
170
            $relation = $this->parser->camelize($relation);
171
            $relationEntityAlias = 'table_' . $relation;
172
173
            $metadata = $this->manager->getClassMetadata($entityName);
174
175
            if ($metadata->hasAssociation($relation)) {
176
177
                $association = $metadata->getAssociationMapping($relation);
178
179
                $fieldName = $this->parser->camelize($association['fieldName']);
180
181
                if ($this->noExistsJoin($relationEntityAlias, $relation)) {
182
183
                    $this->qBuilder
184
                            ->join($entityAlias . "." . $fieldName, $relationEntityAlias);
185
186
                    $this->storeJoin($relationEntityAlias, $relation);
187
                }
188
                $entityName = $association['targetEntity'];
189
                $entityAlias = $relationEntityAlias;
190
            }
191
192
            $this->setRelationEntityAlias($relationEntityAlias);
193
        }
194
195
        return $this;
196
    }
197
198
    public function filter()
199
    {
200
        $this->ensureFilteringIsDefined();
201
        $this->ensureFieldsDefined();
202
203
        foreach ($this->filtering as $filter => $value) {
204
            $this->applyFilterAnd($filter, $value);
205
        }
206
207
        if (null !== $this->orFiltering) {
208
            $orFilter = [];
209
            $orFilter['orCondition'] = null;
210
            $orFilter['parameters'] = [];
211
212
            foreach ($this->orFiltering as $filter => $value) {
213
                $orFilter = $this->applyFilterOr($filter, $value, $orFilter);
214
            }
215
216
            if ((count($orFilter) > 0) && ($orFilter['orCondition'] != null)) {
217
                $this->qBuilder->andWhere($orFilter['orCondition']);
218
219
                foreach ($orFilter['parameters'] as $parameter) {
220
                    $this->qBuilder->setParameter($parameter['field'], $parameter['value']);
221
                }
222
            }
223
        }
224
225
        return $this;
226
    }
227
228
    private function applyFilterAnd($filter, $value)
229
    {
230
        $whereCondition = null;
231
        $filtering = FilteringObject::fromFilter($filter);
232
        $fieldName = $this->parser->camelize($filtering->getFieldName());
233
234
        $operator = Operators::getDefaultOperator();
235
        if($filtering->hasOperator()){
236
            $operator = Operators::get($filtering->getOperator());
237
        }
238
239
        // controllo se il filtro che mi arriva dalla richiesta è una proprietà di questa entità
240
        // esempio per users: filtering[username|contains]=mado
241
        if (in_array($fieldName, $this->fields)) {
242
243
            $salt = '';
244 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...
245
                if ($parameter->getName() == 'field_' . $fieldName) {
246
                    $salt = '_' . rand(111, 999);
247
                }
248
            }
249
250 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...
251
                if ('list' == $filtering->getOperator()) {
252
                    $whereCondition = $this->entityAlias.'.'.$fieldName.' '.$operator['meta'].' (:field_'.$fieldName . $salt . ')';
253
                } else if ('field_eq' == $filtering->getOperator()) {
254
                    $whereCondition =
255
                        $this->entityAlias . '.' . $fieldName . ' '.
256
                        $operator['meta'] . '' .
257
                        $this->entityAlias . '.' . $value
258
                        ;
259
                } else {
260
                    $whereCondition = $this->entityAlias.'.'.$fieldName.' '.$operator['meta'].' :field_'.$fieldName . $salt;
261
                }
262
            } else {
263
                $whereCondition = $this->entityAlias.'.'.$fieldName.' = :field_'.$fieldName . $salt;
264
            }
265
266
            $this->qBuilder->andWhere($whereCondition);
267
268 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...
269
                if ($filtering->hasOperator() && 'list' == $filtering->getOperator()) {
270
                    $value = explode(',', $value);
271
                } else {
272
                    $value = str_replace(
273
                        '{string}',
274
                        $value,
275
                        $operator['substitution_pattern']
276
                    );
277
                }
278
            }
279
280
            $this->qBuilder->setParameter('field_' . $fieldName . $salt, $value);
281
        } else {
282
            $isNotARelation = 0 !== strpos($fieldName, 'Embedded.');
283
            if ($isNotARelation) {
284
                $whereCondition = $this->entityAlias.'.'.$fieldName.' '.$operator['meta'].' ' . $this->entityAlias . '.' . $value;
285
                $this->qBuilder->andWhere($whereCondition);
286
            }
287
        }
288
289
        // controllo se il filtro si riferisce ad una relazione dell'entità quindi devo fare dei join
290
        // esempio per users: filtering[_embedded.groups.name|eq]=admin
291
        if (strstr($filter, '_embedded.')) {
292
293
            $this->join($filter);
294
            $relationEntityAlias = $this->getRelationEntityAlias();
295
296
            $embeddedFields = explode('.', $fieldName);
297
            $fieldName = $this->parser->camelize($embeddedFields[count($embeddedFields)-1]);
298
299
            $salt = '';
300 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...
301
                if ($parameter->getName() == 'field_' . $fieldName) {
302
                    $salt = '_' . rand(111, 999);
303
                }
304
            }
305
306 View Code Duplication
            if ($filtering->hasOperator() && 'list' == $filtering->getOperator()) {
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...
307
                $whereCondition = $relationEntityAlias.'.'.$fieldName.' '.$operator['meta'].' (:field_'.$fieldName . $salt . ')';
308
            } else {
309
                $whereCondition = $relationEntityAlias.'.'.$fieldName.' '.$operator['meta'].' :field_'.$fieldName . $salt;
310
            }
311
312
            $this->qBuilder->andWhere($whereCondition);
313 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...
314
                if ($filtering->hasOperator() && 'list' == $filtering->getOperator()) {
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
                    $value = str_replace(
318
                        '{string}',
319
                        $value,
320
                        $operator['substitution_pattern']
321
                    );
322
                }
323
            }
324
325
            $this->qBuilder->setParameter('field_' . $fieldName . $salt, $value);
326
        }
327
    }
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
        $operator = Operators::getDefaultOperator();
337
        if($filtering->hasOperator()) {
338
            $operator = Operators::get($filtering->getOperator());
339
        }
340
341
        // controllo se il filtro che mi arriva dalla richiesta è una proprietà di questa entità
342
        // esempio per users: filtering[username|contains]=mado
343
        if (in_array($fieldName, $this->fields)) {
344
345
            $salt = '';
346 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...
347
                if ($parameter->getName() == 'field_' . $fieldName) {
348
                    $salt = '_' . rand(111, 999);
349
                }
350
            }
351
352 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...
353
                if ('list' == $filtering->getOperator()) {
354
                    $whereCondition = $this->entityAlias.'.'.$fieldName.' '.$operator['meta'].' (:field_'.$fieldName . $salt . ')';
355
                } else if ('field_eq' == $filtering->getOperator()) {
356
                    $whereCondition =
357
                        $this->entityAlias . '.' . $fieldName . ' '.
358
                        $operator['meta'] . '' .
359
                        $this->entityAlias . '.' . $value
360
                    ;
361
                } else {
362
                    $whereCondition = $this->entityAlias.'.'.$fieldName.' '.$operator['meta'].' :field_'.$fieldName . $salt;
363
                }
364
            } else {
365
                $whereCondition = $this->entityAlias.'.'.$fieldName.' = :field_'.$fieldName . $salt;
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 (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...
375
                if ($filtering->hasOperator() && 'list' == $filtering->getOperator()) {
376
                    $value = explode(',', $value);
377
                } else {
378
                    $value = str_replace(
379
                        '{string}',
380
                        $value,
381
                        $operator['substitution_pattern']
382
                    );
383
                }
384
            }
385
386
            $orCondition['parameters'][] = [
387
                'field' => 'field_' . $fieldName . $salt,
388
                'value' => $value
389
            ];
390
        } else {
391
            $isNotARelation = 0 !== strpos($fieldName, 'Embedded.');
392
            if ($isNotARelation) {
393
                $whereCondition = $this->entityAlias.'.'.$fieldName.' '.$operator['meta'].' ' . $this->entityAlias . '.' . $value;
394 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...
395
                    $orCondition['orCondition'] .= ' OR ' . $whereCondition;
396
                } else {
397
                    $orCondition['orCondition'] = $whereCondition;
398
                }
399
            }
400
        }
401
402
        // controllo se il filtro si riferisce ad una relazione dell'entità quindi devo fare dei join
403
        // esempio per users: filtering[_embedded.groups.name|eq]=admin
404
        if (strstr($filter, '_embedded.')) {
405
406
            $this->join($filter);
407
            $relationEntityAlias = $this->getRelationEntityAlias();
408
409
            $embeddedFields = explode('.', $fieldName);
410
            $fieldName = $this->parser->camelize($embeddedFields[count($embeddedFields)-1]);
411
412
            $salt = '';
413 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...
414
                if ($parameter->getName() == 'field_' . $fieldName) {
415
                    $salt = '_' . rand(111, 999);
416
                }
417
            }
418
419 View Code Duplication
            if ($filtering->hasOperator() && 'list' == $filtering->getOperator()) {
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...
420
                $whereCondition = $relationEntityAlias.'.'.$fieldName.' '.$operator['meta'].' (:field_'.$fieldName . $salt . ')';
421
            } else {
422
                $whereCondition = $relationEntityAlias.'.'.$fieldName.' '.$operator['meta'].' :field_'.$fieldName . $salt;
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 (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...
432
                if ($filtering->hasOperator() && 'list' == $filtering->getOperator()) {
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
                        $operator['substitution_pattern']
439
                    );
440
                }
441
            }
442
443
            $orCondition['parameters'][] = [
444
                'field' => 'field_' . $fieldName . $salt,
445
                'value' => $value
446
            ];
447
        }
448
449
        return $orCondition;
450
    }
451
452
    public function sort()
453
    {
454
        $this->ensureFieldsDefined();
455
        $this->ensureSortingIsDefined();
456
457
        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
        return $this;
481
    }
482
483
    public function getQueryBuilder()
484
    {
485
        $this->ensureQueryBuilderIsDefined();
486
487
        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
    private function setRelationEntityAlias(string $relationEntityAlias)
502
    {
503
        $this->relationEntityAlias = $relationEntityAlias;
504
    }
505
506
    private function getRelationEntityAlias()
507
    {
508
        return $this->relationEntityAlias;
509
    }
510
511
    public function setRel($rel)
512
    {
513
        $this->rel = $rel;
514
515
        return $this;
516
    }
517
518
    public function getRel()
519
    {
520
        return $this->rel;
521
    }
522
523
    public function setPrinting($printing)
524
    {
525
        $this->printing = $printing;
526
527
        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
    public function setSelect(string $select) : QueryBuilderFactory
560
    {
561
        $this->select = $select;
562
563
        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