public function detach($id)
    {
        $instance = $this->_getOrThrow($id, ['locked' => false]);
        $this->loadModel('Field.FieldInstances');

        if ($this->FieldInstances->delete($instance)) {
            $this->Flash->success(__d('field', 'Field detached successfully!'));
        } else {
            $this->Flash->danger(__d('field', 'Field could not be detached'));
        }

        $this->title(__d('field', 'Detach Field'));
        $this->redirect($this->referer());
    }
public function detach($id)
    {
        $instance = $this->_getOrThrow($id, ['locked' => false]);
        $this->loadModel('Field.FieldInstances');

        if ($this->FieldInstances->delete($instance)) {
            $this->Flash->success(__d('field', 'Field detached successfully!'));
        } else {
            $this->Flash->danger(__d('field', 'Field could not be detached'));
        }

        $this->title(__d('field', 'Detach Field'));
        $this->redirect($this->referer());
    }
public function detach ( $ id ) { $ instance = $ this -> _getOrThrow ( $ id , [ 'locked' => false ] ) ; $ this -> loadModel ( 'Field.FieldInstances' ) ; if ( $ this -> FieldInstances -> delete ( $ instance ) ) { $ this -> Flash -> success ( __d ( 'field' , 'Field detached successfully!' ) ) ; } else { $ this -> Flash -> danger ( __d ( 'field' , 'Field could not be detached' ) ) ; } $ this -> title ( __d ( 'field' , 'Detach Field' ) ) ; $ this -> redirect ( $ this -> referer ( ) ) ; }
Detach action.

Detaches a Field from table being managed.

@param int $id ID of the instance to detach
@return void
Detach action .