|
@@ 272-278 (lines=7) @@
|
| 269 |
|
* Gets the previous sibling of the node. |
| 270 |
|
* @return \yii\db\ActiveQuery |
| 271 |
|
*/ |
| 272 |
|
public function prev() |
| 273 |
|
{ |
| 274 |
|
$condition = [$this->rightAttribute => $this->owner->getAttribute($this->leftAttribute) - 1]; |
| 275 |
|
$this->applyTreeAttributeCondition($condition); |
| 276 |
|
|
| 277 |
|
return $this->owner->find()->andWhere($condition); |
| 278 |
|
} |
| 279 |
|
|
| 280 |
|
/** |
| 281 |
|
* Gets the next sibling of the node. |
|
@@ 284-290 (lines=7) @@
|
| 281 |
|
* Gets the next sibling of the node. |
| 282 |
|
* @return \yii\db\ActiveQuery |
| 283 |
|
*/ |
| 284 |
|
public function next() |
| 285 |
|
{ |
| 286 |
|
$condition = [$this->leftAttribute => $this->owner->getAttribute($this->rightAttribute) + 1]; |
| 287 |
|
$this->applyTreeAttributeCondition($condition); |
| 288 |
|
|
| 289 |
|
return $this->owner->find()->andWhere($condition); |
| 290 |
|
} |
| 291 |
|
|
| 292 |
|
/** |
| 293 |
|
* Determines whether the node is root. |