예제 #1
0
파일: Menu.php 프로젝트: kuzmiand/easyii
 /**
  * Retrieve menu items
  * @return mixed
  */
 public function getMenuItems()
 {
     return $this->hasMany(MenuItem::className(), ['item_id' => 'menu_id'])->sort();
 }
예제 #2
0
 /**
  * Get direct children
  * @return \yii\db\ActiveQuery
  */
 public function getChildren()
 {
     return $this->hasMany(MenuItem::className(), ['parent_id' => 'menu_item_id'])->orderBy(["order_num" => SORT_ASC]);
 }
예제 #3
0
 /**
  * @return array
  */
 public function behaviors()
 {
     return ['status' => ['class' => StatusController::className(), 'model' => MenuItem::className()]];
 }