* @license MIT (https://github.com/paulzi/yii2-nested-sets/blob/master/LICENSE) */ namespace paulzi\nestedsets; /** * @author PaulZi */ trait NestedSetsQueryTrait { /** * @return \yii\db\ActiveQuery */ public function roots() { /** @var \yii\db\ActiveQuery $this */ $class = $this->modelClass; $model = new $class; return $this->andWhere([$model->leftAttribute => 1]); } }