original_string: public function edit($id)
      {
          $this->loadModel('Menu.Menus');
          $menu = $this->Menus->get($id);
  
          if ($this->request->data()) {
              $menu = $this->Menus->patchEntity($menu, $this->request->data(), [
                  'fieldList' => [
                      'title',
                      'description',
                      'settings',
                  ],
                  'validate' => false
              ]);
  
              if ($this->Menus->save($menu, ['atomic' => true])) {
                  $this->Flash->success(__d('menu', 'Menu has been saved!'));
                  $this->redirect($this->referer());
              } else {
                  $this->Flash->danger(__d('menu', 'Menu could not be saved, please check your information'));
              }
          }
  
          $this->title(__d('menu', 'Editing Menu'));
          $this->set('menu', $menu);
          $this->Breadcrumb
              ->push('/admin/menu/manage')
              ->push(__d('menu', 'Editing menu {0}', $menu->title), '#');
      }
code: public function edit($id)
      {
          $this->loadModel('Menu.Menus');
          $menu = $this->Menus->get($id);
  
          if ($this->request->data()) {
              $menu = $this->Menus->patchEntity($menu, $this->request->data(), [
                  'fieldList' => [
                      'title',
                      'description',
                      'settings',
                  ],
                  'validate' => false
              ]);
  
              if ($this->Menus->save($menu, ['atomic' => true])) {
                  $this->Flash->success(__d('menu', 'Menu has been saved!'));
                  $this->redirect($this->referer());
              } else {
                  $this->Flash->danger(__d('menu', 'Menu could not be saved, please check your information'));
              }
          }
  
          $this->title(__d('menu', 'Editing Menu'));
          $this->set('menu', $menu);
          $this->Breadcrumb
              ->push('/admin/menu/manage')
              ->push(__d('menu', 'Editing menu {0}', $menu->title), '#');
      }
code_tokens: public function edit ( $ id ) { $ this -> loadModel ( 'Menu.Menus' ) ; $ menu = $ this -> Menus -> get ( $ id ) ; if ( $ this -> request -> data ( ) ) { $ menu = $ this -> Menus -> patchEntity ( $ menu , $ this -> request -> data ( ) , [ 'fieldList' => [ 'title' , 'description' , 'settings' , ] , 'validate' => false ] ) ; if ( $ this -> Menus -> save ( $ menu , [ 'atomic' => true ] ) ) { $ this -> Flash -> success ( __d ( 'menu' , 'Menu has been saved!' ) ) ; $ this -> redirect ( $ this -> referer ( ) ) ; } else { $ this -> Flash -> danger ( __d ( 'menu' , 'Menu could not be saved, please check your information' ) ) ; } } $ this -> title ( __d ( 'menu' , 'Editing Menu' ) ) ; $ this -> set ( 'menu' , $ menu ) ; $ this -> Breadcrumb -> push ( '/admin/menu/manage' ) -> push ( __d ( 'menu' , 'Editing menu {0}' , $ menu -> title ) , '#' ) ; }
docstring: Edits the given menu by ID.
  
  @param int $id Menu's ID
  @return void
docstring_tokens: Edits the given menu by ID .