Conditions | 5 |
Paths | 3 |
Total Lines | 16 |
Code Lines | 10 |
Lines | 0 |
Ratio | 0 % |
Tests | 11 |
CRAP Score | 5 |
Changes | 1 | ||
Bugs | 0 | Features | 0 |
1 | <?php |
||
18 | 472 | protected function deleteChild(Pool $pool, Tuple $tuple, object $child): Tuple |
|
19 | { |
||
20 | 472 | if ($this->isNullable()) { |
|
|
|||
21 | 48 | $rTuple = $pool->attachStore($child, false); |
|
22 | 48 | $relName = $this->getTargetRelationName(); |
|
23 | // Related state |
||
24 | 48 | $state = $rTuple->state; |
|
25 | 48 | if (!$state->hasRelation($relName) || $state->getRelation($relName) === $tuple->entity) { |
|
26 | 48 | foreach ($this->outerKeys as $outerKey) { |
|
27 | 48 | $state->register($outerKey, null); |
|
28 | } |
||
29 | 48 | $state->setRelation($relName, null); |
|
30 | } |
||
31 | 48 | return $rTuple; |
|
32 | } |
||
33 | 424 | return $pool->attachDelete($child, $this->isCascade()); |
|
34 | } |
||
50 |