| @@ 999-1011 (lines=13) @@ | ||
| 996 | * @param int $left |
|
| 997 | * @param int $right |
|
| 998 | */ |
|
| 999 | protected function findPrependRange(&$left, &$right) |
|
| 1000 | { |
|
| 1001 | $left = $this->node->getAttribute($this->leftAttribute); |
|
| 1002 | $right = $this->node->getAttribute($this->rightAttribute); |
|
| 1003 | $child = $this->getNodeBehavior()->getChildren() |
|
| 1004 | ->select($this->leftAttribute) |
|
| 1005 | ->orderBy([$this->leftAttribute => SORT_ASC]) |
|
| 1006 | ->limit(1) |
|
| 1007 | ->scalar(); |
|
| 1008 | if ($child !== false) { |
|
| 1009 | $right = (int)$child; |
|
| 1010 | } |
|
| 1011 | } |
|
| 1012 | ||
| 1013 | /** |
|
| 1014 | * @param int $left |
|
| @@ 1017-1029 (lines=13) @@ | ||
| 1014 | * @param int $left |
|
| 1015 | * @param int $right |
|
| 1016 | */ |
|
| 1017 | protected function findAppendRange(&$left, &$right) |
|
| 1018 | { |
|
| 1019 | $left = $this->node->getAttribute($this->leftAttribute); |
|
| 1020 | $right = $this->node->getAttribute($this->rightAttribute); |
|
| 1021 | $child = $this->getNodeBehavior()->getChildren() |
|
| 1022 | ->select($this->rightAttribute) |
|
| 1023 | ->orderBy([$this->rightAttribute => SORT_DESC]) |
|
| 1024 | ->limit(1) |
|
| 1025 | ->scalar(); |
|
| 1026 | if ($child !== false) { |
|
| 1027 | $left = (int)$child; |
|
| 1028 | } |
|
| 1029 | } |
|
| 1030 | ||
| 1031 | /** |
|
| 1032 | * @param int $left |
|