Пример #1
0
 public function delete()
 {
     //We get all the restaurants of the Restaurateur, and remove the link
     $restaurateur = $this->getRestaurateur();
     if ($restaurateur) {
         $restaurateur->removeRestaurant($this);
         $restaurateur->save();
     }
     $menu = $this->getMenus();
     if ($menu) {
         $menu->delete();
     }
     parent::delete();
 }
Пример #2
0
 /**
  * Delete a Menu
  */
 public function delete()
 {
     //We get all the menuItems of the Menu, and remove them (an item doesn't exist without menu)
     $menuItems = $this->getMenuItems();
     foreach ($menuItems as $menuItem) {
         $menuItem->delete();
     }
     parent::delete();
 }