|
@@ 208-210 (lines=3) @@
|
| 205 |
|
protected function move($position = null, $siblings = [], $oldParentId) |
| 206 |
|
{ |
| 207 |
|
$class = $this->className; |
| 208 |
|
if (null === $oldParent = $class::findOne($oldParentId)) { |
| 209 |
|
return ['error' => Yii::t('jstw', "Old parent with id '{id}' not found!", ['id' => $oldParentId])]; |
| 210 |
|
} |
| 211 |
|
$nodeCountCondition = [ |
| 212 |
|
'and', |
| 213 |
|
['>=', $this->leftAttribute, $this->node{$this->leftAttribute}], |
|
@@ 358-360 (lines=3) @@
|
| 355 |
|
if ((int)$oldParentId == 0) { |
| 356 |
|
return ['error' => Yii::t('jstw', 'Can not move root node as child!')]; |
| 357 |
|
} |
| 358 |
|
if (null === $oldParent = $class::findOne($oldParentId)) { |
| 359 |
|
return ['error' => Yii::t('jstw', "Old parent with id '{id}' not found!", ['id' => $oldParentId])]; |
| 360 |
|
} |
| 361 |
|
$nodeCountCondition = [ |
| 362 |
|
'and', |
| 363 |
|
['>=', $this->leftAttribute, $this->node->{$this->leftAttribute}], |