Exemplo n.º 1
0
 /**
  * @inheritdoc
  */
 public function beforeSave($insert)
 {
     if ($insert && $this->sort === null) {
         $this->sort = Menu::find()->where(['parent_id' => $this->parent_id])->max('sort') + 1;
     }
     return parent::beforeSave($insert);
 }