Crud\Action\DeleteAction::_post PHP Method

_post() protected method

HTTP POST handler
protected _post ( string | null $id = null ) : Response
$id string | null Record id
return Cake\Network\Response
    protected function _post($id = null)
    {
        $subject = $this->_subject();
        $subject->set(['id' => $id]);
        $entity = $this->_findRecord($id, $subject);
        $event = $this->_trigger('beforeDelete', $subject);
        if ($event->isStopped()) {
            return $this->_stopped($subject);
        }
        $method = $this->config('deleteMethod');
        if ($this->_table()->{$method}($entity)) {
            $this->_success($subject);
        } else {
            $this->_error($subject);
        }
        return $this->_redirect($subject, ['action' => 'index']);
    }