@@ 1035-1051 (lines=17) @@ | ||
1032 | * @param int $right |
|
1033 | * @return array|null |
|
1034 | */ |
|
1035 | protected function findInsertBeforeRange(&$left, &$right) |
|
1036 | { |
|
1037 | $result = null; |
|
1038 | $right = $this->node->getAttribute($this->leftAttribute); |
|
1039 | $left = $this->getNodeBehavior()->getPrev() |
|
1040 | ->select($this->rightAttribute) |
|
1041 | ->scalar(); |
|
1042 | if ($left === false) { |
|
1043 | $result = $this->getNodeBehavior()->getParent() |
|
1044 | ->select([$this->leftAttribute, $this->rightAttribute]) |
|
1045 | ->createCommand() |
|
1046 | ->queryOne(); |
|
1047 | $left = $result[$this->leftAttribute]; |
|
1048 | } |
|
1049 | $left = (int)$left; |
|
1050 | return $result; |
|
1051 | } |
|
1052 | ||
1053 | /** |
|
1054 | * @param int $left |
|
@@ 1058-1074 (lines=17) @@ | ||
1055 | * @param int $right |
|
1056 | * @return array|null |
|
1057 | */ |
|
1058 | protected function findInsertAfterRange(&$left, &$right) |
|
1059 | { |
|
1060 | $result = null; |
|
1061 | $left = $this->node->getAttribute($this->rightAttribute); |
|
1062 | $right = $this->getNodeBehavior()->getNext() |
|
1063 | ->select($this->leftAttribute) |
|
1064 | ->scalar(); |
|
1065 | if ($right === false) { |
|
1066 | $result = $this->getNodeBehavior()->getParent() |
|
1067 | ->select([$this->leftAttribute, $this->rightAttribute]) |
|
1068 | ->createCommand() |
|
1069 | ->queryOne(); |
|
1070 | $right = $result[$this->rightAttribute]; |
|
1071 | } |
|
1072 | $right = (int)$right; |
|
1073 | return $result; |
|
1074 | } |
|
1075 | ||
1076 | /** |
|
1077 | * @param int $value |