Hi, I would like use this extension
https://github.com/creocoder/yii2-nested-sets and Create the Model of example and i gets error when i try create root category-menu
<?php
namespace frontend\models;
use common\models\Category;
use creocoder\nestedsets\NestedSetsBehavior;
use yii\db\ActiveRecord;
class Menu extends ActiveRecord
{
public function behaviors()
{
return [
'tree' => [
'class' => NestedSetsBehavior::className(),
'treeAttribute' => 'tree',
'leftAttribute' => 'lft',
'rightAttribute' => 'rgt',
'depthAttribute' => 'depth',
],
];
}
public function transactions()
{
return [
self::SCENARIO_DEFAULT => self::OP_ALL,
];
}
public static function find()
{
return new MenuQuery(get_called_class());
}
}
I have table menu in Database whose i created through migration.
What is wrong?