public function behaviors() { $behaviors = []; $model = $this->modelClass; //$model = new $model; if ($model->hasAttribute($model->removedAttribute)) { $behaviors[] = TrashQueryBehavior::className(); } if ($model->hasAttribute('lft') && $model->hasAttribute('rgt') && $model->hasAttribute('depth')) { $behaviors[] = NestedSetsQueryBehavior::className(); } return $behaviors; }
public function behaviors() { return [TrashQueryBehavior::className()]; }