diff --git a/NestedSetsQueryTrait.php b/NestedSetsQueryTrait.php index 792f0ae..9e0a480 100644 --- a/NestedSetsQueryTrait.php +++ b/NestedSetsQueryTrait.php @@ -19,12 +19,7 @@ trait NestedSetsQueryTrait { /** @var \yii\db\ActiveQuery $this */ $class = $this->modelClass; - if (isset($class::$nestedSetsLeftAttribute)) { - return $this->andWhere([$class::$nestedSetsLeftAttribute => 1]); - } else { - /** @var \yii\db\ActiveRecord|NestedSetsBehavior $model */ - $model = new $class; - return $this->andWhere([$model->leftAttribute => 1]); - } + $model = new $class; + return $this->andWhere([$model->leftAttribute => 1]); } }