src/php/main/Eix/Services/Data/Responders/CollectionManager.php
protected function getBatchActionResponse($actionFunction, array $selectedIds)
    {
        $response = $this->getIndexRedirectionResponse();

        $successfullyUsedIds = array();
        foreach ($selectedIds as $id) {
            try {
                call_user_func($actionFunction, $id);
                $successfullyUsedIds[] = $id;
            } catch (NotFoundException $exception) {
                $response->addErrorMessage(sprintf(_('%s %s was not found.'),
                    _($this->getItemName()),
                    $id
                ));
            }
        }

        // TODO: Create a Report with the successfully used IDs.

        $response->addNotice(sprintf(_('%d %s were affected.'),
            count($successfullyUsedIds), _($this->getCollectionName())
        ));

        return $response;
    }
protected function getBatchActionResponse($actionFunction, array $selectedIds)
    {
        $response = $this->getIndexRedirectionResponse();

        $successfullyUsedIds = array();
        foreach ($selectedIds as $id) {
            try {
                call_user_func($actionFunction, $id);
                $successfullyUsedIds[] = $id;
            } catch (NotFoundException $exception) {
                $response->addErrorMessage(sprintf(_('%s %s was not found.'),
                    _($this->getItemName()),
                    $id
                ));
            }
        }

        // TODO: Create a Report with the successfully used IDs.

        $response->addNotice(sprintf(_('%d %s were affected.'),
            count($successfullyUsedIds), _($this->getCollectionName())
        ));

        return $response;
    }
protected function getBatchActionResponse ( $ actionFunction , array $ selectedIds ) { $ response = $ this -> getIndexRedirectionResponse ( ) ; $ successfullyUsedIds = array ( ) ; foreach ( $ selectedIds as $ id ) { try { call_user_func ( $ actionFunction , $ id ) ; $ successfullyUsedIds [ ] = $ id ; } catch ( NotFoundException $ exception ) { $ response -> addErrorMessage ( sprintf ( _ ( '%s %s was not found.' ) , _ ( $ this -> getItemName ( ) ) , $ id ) ) ; } } // TODO: Create a Report with the successfully used IDs. $ response -> addNotice ( sprintf ( _ ( '%d %s were affected.' ) , count ( $ successfullyUsedIds ) , _ ( $ this -> getCollectionName ( ) ) ) ) ; return $ response ; }
Issue a response to a batch action request.

@param callback $actionFunction the function that will be executed for
each of the selected IDs.
@param array $selectedIds the IDs on which the batch process must be
executed.
Issue a response to a batch action request .