@@ 190-199 (lines=10) @@ | ||
187 | /** |
|
188 | * @return \yii\db\ActiveQuery |
|
189 | */ |
|
190 | public function getPrev() |
|
191 | { |
|
192 | $tableName = $this->owner->tableName(); |
|
193 | $query = $this->owner->find() |
|
194 | ->andWhere(["{$tableName}.[[{$this->rightAttribute}]]" => $this->owner->getAttribute($this->leftAttribute) - 1]) |
|
195 | ->andWhere($this->treeCondition()) |
|
196 | ->limit(1); |
|
197 | $query->multiple = false; |
|
198 | return $query; |
|
199 | } |
|
200 | ||
201 | /** |
|
202 | * @return \yii\db\ActiveQuery |
|
@@ 204-213 (lines=10) @@ | ||
201 | /** |
|
202 | * @return \yii\db\ActiveQuery |
|
203 | */ |
|
204 | public function getNext() |
|
205 | { |
|
206 | $tableName = $this->owner->tableName(); |
|
207 | $query = $this->owner->find() |
|
208 | ->andWhere(["{$tableName}.[[{$this->leftAttribute}]]" => $this->owner->getAttribute($this->rightAttribute) + 1]) |
|
209 | ->andWhere($this->treeCondition()) |
|
210 | ->limit(1); |
|
211 | $query->multiple = false; |
|
212 | return $query; |
|
213 | } |
|
214 | ||
215 | /** |
|
216 | * Populate children relations for self and all descendants |