src/Controller/Component/ProcessComponent.php
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);
    }
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);
    }
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 ) ; }
Make process.

@param   Table $table
@param   string $action
@param   array $ids
@param   array $options
@return  \Cake\Http\Response|null

@throws  \Aura\Intl\Exception
Make process .