original_string: protected function _edit($id) {
  		try {
  			$result = $this->{$this->modelClass}->edit($id, $this->request->data);
  		} catch (OutOfBoundsException $e) {
  			return $this->alert($e, array('redirect' => $this->referer(array('action' => 'list'), true)));
  		}
  
  		$this->request->data = $this->{$this->modelClass}->data;
  
  		if (!empty($this->request->data[$this->{$this->modelClass}->alias][$this->{$this->modelClass}->displayField])) {
  			$this->_appendToCrumb($this->request->data[$this->{$this->modelClass}->alias][$this->{$this->modelClass}->displayField]);
  		}
  
  		if (false === $result) {
  			$this->alert('save.fail');
  		} else if ($this->request->is('put')) {
  			$this->alert('save.success');
  		}
  	}
code: protected function _edit($id) {
  		try {
  			$result = $this->{$this->modelClass}->edit($id, $this->request->data);
  		} catch (OutOfBoundsException $e) {
  			return $this->alert($e, array('redirect' => $this->referer(array('action' => 'list'), true)));
  		}
  
  		$this->request->data = $this->{$this->modelClass}->data;
  
  		if (!empty($this->request->data[$this->{$this->modelClass}->alias][$this->{$this->modelClass}->displayField])) {
  			$this->_appendToCrumb($this->request->data[$this->{$this->modelClass}->alias][$this->{$this->modelClass}->displayField]);
  		}
  
  		if (false === $result) {
  			$this->alert('save.fail');
  		} else if ($this->request->is('put')) {
  			$this->alert('save.success');
  		}
  	}
code_tokens: protected function _edit ( $ id ) { try { $ result = $ this -> { $ this -> modelClass } -> edit ( $ id , $ this -> request -> data ) ; } catch ( OutOfBoundsException $ e ) { return $ this -> alert ( $ e , array ( 'redirect' => $ this -> referer ( array ( 'action' => 'list' ) , true ) ) ) ; } $ this -> request -> data = $ this -> { $ this -> modelClass } -> data ; if ( ! empty ( $ this -> request -> data [ $ this -> { $ this -> modelClass } -> alias ] [ $ this -> { $ this -> modelClass } -> displayField ] ) ) { $ this -> _appendToCrumb ( $ this -> request -> data [ $ this -> { $ this -> modelClass } -> alias ] [ $ this -> { $ this -> modelClass } -> displayField ] ) ; } if ( false === $ result ) { $ this -> alert ( 'save.fail' ) ; } else if ( $ this -> request -> is ( 'put' ) ) { $ this -> alert ( 'save.success' ) ; } }
docstring: Common edit action.
  
  @param string $id Model's record primary key value.
  @return void
docstring_tokens: Common edit action .