creocoder / yii2-nested-sets

The nested sets behavior for the Yii framework.
Other
446 stars 129 forks source link

example in readme does not work without ->one() #20

Closed dynasource closed 9 years ago

dynasource commented 10 years ago

https://github.com/creocoder/yii2-nested-set-behavior#adding-child-nodes

Original: $root = Category::find(1); //returns ActiveQuery object, resulting into errors

Suggestion: $root = Category::findOne(1); //returns Active record, which can be used by NestedSet.php

creocoder commented 9 years ago

Fixed inside new documentation which coming with new stable behavior version for Yii 2 release.