public function leaves() {
        $condition = [
            'and',
            [$this->leftAttribute => ['$gt' => $this->owner->getAttribute($this->leftAttribute)]],
            [$this->rightAttribute => ['$lt' => $this->owner->getAttribute($this->rightAttribute)]],
            ['$where' => "this.{$this->rightAttribute} = this.{$this->leftAttribute} + 1"]
        ];

        $this->applyTreeAttributeCondition($condition);

        return $this->owner->find()->andWhere($condition)->addOrderBy([$this->leftAttribute => SORT_ASC]);
    }
public function leaves() {
        $condition = [
            'and',
            [$this->leftAttribute => ['$gt' => $this->owner->getAttribute($this->leftAttribute)]],
            [$this->rightAttribute => ['$lt' => $this->owner->getAttribute($this->rightAttribute)]],
            ['$where' => "this.{$this->rightAttribute} = this.{$this->leftAttribute} + 1"]
        ];

        $this->applyTreeAttributeCondition($condition);

        return $this->owner->find()->andWhere($condition)->addOrderBy([$this->leftAttribute => SORT_ASC]);
    }
public function leaves ( ) { $ condition = [ 'and' , [ $ this -> leftAttribute => [ '$gt' => $ this -> owner -> getAttribute ( $ this -> leftAttribute ) ] ] , [ $ this -> rightAttribute => [ '$lt' => $ this -> owner -> getAttribute ( $ this -> rightAttribute ) ] ] , [ '$where' => "this.{$this->rightAttribute} = this.{$this->leftAttribute} + 1" ] ] ; $ this -> applyTreeAttributeCondition ( $ condition ) ; return $ this -> owner -> find ( ) -> andWhere ( $ condition ) -> addOrderBy ( [ $ this -> leftAttribute => SORT_ASC ] ) ; }
Gets the leaves of the node.
@return \yii\db\ActiveQuery
Gets the leaves of the node .