diff --git a/README.md b/README.md index e18f544..5070925 100644 --- a/README.md +++ b/README.md @@ -83,12 +83,21 @@ class m150722_150100_multiple_tree extends Migration ```php use paulzi\nestedsets\NestedSetsBehavior; +/** + * @property integer $id + * @property integer $lft + * @property integer $rgt + * @property integer $depth + * + * @mixin NestedSetsBehavior + */ + class Sample extends \yii\db\ActiveRecord { public function behaviors() { return [ [ - 'class' => NestedSetsBehavior::className(), + 'class' => NestedSetsBehavior::class, // 'treeAttribute' => 'tree', ], ]; @@ -291,4 +300,4 @@ To delete a node with descendants: $node11 = Sample::findOne(['name' => 'node 1.1']); $node11->delete(); // delete node, children come up to the parent $node11->deleteWithChildren(); // delete node and all descendants -``` \ No newline at end of file +```