public function make(Table $table, $action, array $ids = [], array $options = [])
    {
        $count       = count($ids);
        $options     = $this->_getOptions($options, $count);
        $redirectUrl = $options['redirect'];
        $messages    = new JSON($options['messages']);

        $event = EventManager::trigger($this->_getEventName($action), $this->_controller, ['ids' => $ids]);
        $ids   = (array) $event->getData('ids');
        $count = count($ids);

        if (!$action) {
            $this->Flash->error($messages->get('no_action'));
            return $this->_controller->redirect($redirectUrl);
        }

        if ($count <= 0) {
            $this->Flash->error($messages->get('no_choose'));
            return $this->_controller->redirect($redirectUrl);
        }

        $this->_loadBehavior($table);
        if ($table->process($action, $ids)) {
            return $this->_process($action, $messages, $redirectUrl, $ids);
        }

        $this->Flash->error(__d('core', 'An error has occurred. Please try again.'));
        return $this->_controller->redirect($redirectUrl);
    }