| Conditions | 4 |
| Paths | 4 |
| Total Lines | 23 |
| Code Lines | 11 |
| Lines | 0 |
| Ratio | 0 % |
| Changes | 0 | ||
| 1 | <?php |
||
| 30 | public function queue(CC $parentStore, $parentEntity, Node $parentNode, $related, $original): CommandInterface |
||
| 31 | { |
||
| 32 | if (is_null($related)) { |
||
| 33 | if ($this->isRequired()) { |
||
| 34 | throw new NullException("Relation {$this} can not be null"); |
||
| 35 | } |
||
| 36 | |||
| 37 | if (!is_null($original)) { |
||
| 38 | // reset the key |
||
| 39 | $parentStore->register($this->innerKey, null, true); |
||
| 40 | } |
||
| 41 | |||
| 42 | // nothing to do |
||
| 43 | return new Nil(); |
||
| 44 | } |
||
| 45 | |||
| 46 | $relStore = $this->orm->queueStore($related); |
||
|
|
|||
| 47 | $relNode = $this->getNode($related); |
||
| 48 | $this->assertValid($relNode); |
||
| 49 | |||
| 50 | $this->forwardContext($relNode, $this->outerKey, $parentStore, $parentNode, $this->innerKey); |
||
| 51 | |||
| 52 | return $relStore; |
||
| 53 | } |
||
| 55 |