Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?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());
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement