From 11068186c07d0775a6065748cb9b749139ed40be Mon Sep 17 00:00:00 2001 From: PaulZi Date: Wed, 29 Jul 2015 13:56:56 +0300 Subject: [PATCH] Clean usage of Trait variant --- NestedSetsQueryTrait.php | 9 ++------- 1 file changed, 2 insertions(+), 7 deletions(-) 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]); } }