| Total Complexity | 99 |
| Total Lines | 595 |
| Duplicated Lines | 21.34 % |
| Coverage | 0.72% |
| Changes | 0 | ||
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 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 |
||
| 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() |
||
| 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 = []) |
||
| 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) |
||
| 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]); |
||
|
|
|||
| 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) { |
|
| 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])) { |
|
| 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'])) { |
|
| 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) { |
|
| 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]) { |
|
| 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'])) { |
|
| 310 | if (isset($filterAndOperator[1]) && 'list' == $filterAndOperator[1]) { |
||
| 311 | $value = explode(',', $value); |
||
| 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) { |
|
| 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])) { |
|
| 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) { |
|
| 377 | $orCondition['orCondition'] .= ' OR ' . $whereCondition; |
||
| 378 | } else { |
||
| 379 | $orCondition['orCondition'] = $whereCondition; |
||
| 380 | } |
||
| 381 | |||
| 382 | View Code Duplication | if (isset($operator['substitution_pattern'])) { |
|
| 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) { |
|
| 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) { |
|
| 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]) { |
|
| 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) { |
|
| 438 | $orCondition['orCondition'] .= ' OR ' . $whereCondition; |
||
| 439 | } else { |
||
| 440 | $orCondition['orCondition'] = $whereCondition; |
||
| 441 | } |
||
| 442 | |||
| 443 | View Code Duplication | if (isset($operator['substitution_pattern'])) { |
|
| 444 | if (isset($filterAndOperator[1]) && 'list' == $filterAndOperator[1]) { |
||
| 445 | $value = explode(',', $value); |
||
| 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( |
||
| 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() |
||
| 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() |
||
| 594 | } |
||
| 595 | |||
| 596 | public function getEntityManager() |
||
| 597 | { |
||
| 598 | return $this->manager; |
||
| 599 | } |
||
| 600 | |||
| 601 | public function setConfigProvider(ConfigProvider $configProvider) |
||
| 604 | } |
||
| 605 | } |
||
| 606 |