['power_id', 'menu_id'], 'message' => 'The combination of Power ID and Menu ID has already been taken.'], ]; } /** * @inheritdoc */ public function attributeLabels() { return [ 'power_id' => 'Power ID', 'menu_id' => 'Menu ID', ]; } public function getMenus() { return $this->hasOne(MenuT::className(),['id'=>'menu_id']); } public function getPower() { return $this->hasOne(PowerT::className(),['id'=>'power_id']); } }