Ubiquity 2.5.2
php rapid development framework
Loading...
Searching...
No Matches
PendingRelationsRequest.php
Go to the documentation of this file.
1<?php
2
3namespace Ubiquity\orm\core;
4
6 public static $MAX_ROW_COUNT = 35;
11 protected $objectsConditionParsers = [ ];
17
18 public function __construct() {
19 $this->addNewParser ();
20 }
21
22 public function addPartObject($object, $condition, $value) {
23 $inserted = false;
24 $i = 0;
25 $count = \count ( $this->objectsConditionParsers );
26 while ( ! $inserted && $i < $count ) {
27 $objectsConditionParser = $this->objectsConditionParsers [$i];
28 if ($objectsConditionParser->hasParam ( $value )) {
29 $objectsConditionParser->addObject ( $object );
30 $inserted = true;
31 }
32 $i ++;
33 }
34 if (! $inserted) {
35 $this->getActiveParser ()->addPartObject ( $object, $condition, $value );
36 }
37 }
38
39 protected function addNewParser(): ObjectsConditionParser {
40 $this->activeObjectsParser = new ObjectsConditionParser ();
41 return $this->objectsConditionParsers [] = $this->activeObjectsParser;
42 }
43
45 if ($this->activeObjectsParser->isFull ()) {
46 return $this->addNewParser ();
47 }
48 return $this->activeObjectsParser;
49 }
50
55 public function getObjectsConditionParsers(): array {
56 return $this->objectsConditionParsers;
57 }
58}
59