public function exportUserActionToCsv(array $finderParams = [])
    {
        // Initialize variables
        $queryParams = FinderProvider::parseQueryParams($finderParams);
        $allFilters = $queryParams['allFilters'];
        $sortBy = $queryParams['sortBy'];
        $limit = self::CSV_LOG_BATCH;
        $page = 0;
        $count = 0;
        $total = intval($this->logRepository->fetchUserActionsList($allFilters, true));

        // Prepare CSV file
        $handle = fopen('php://output', 'w+');
        fputcsv($handle, [
            $this->translator->trans('user', [], 'platform'),
            $this->translator->trans('actions', [], 'platform'),
        ], ';', '"');

        // Get batched logs
        while ($count === 0 || $count < $total) {
            $logs = $logs = $this->logRepository->fetchUsersByActionsList($allFilters, false, $page, $limit, $sortBy);
            $count += self::CSV_LOG_BATCH;
            ++$page;

            foreach ($logs as $log) {
                fputcsv($handle, [
                    $log['doerLastName'].' '.$log['doerFirstName'],
                    $log['actions'],
                ], ';', '"');
            }
        }

        fclose($handle);

        return $handle;
    }
public function exportUserActionToCsv(array $finderParams = [])
    {
        // Initialize variables
        $queryParams = FinderProvider::parseQueryParams($finderParams);
        $allFilters = $queryParams['allFilters'];
        $sortBy = $queryParams['sortBy'];
        $limit = self::CSV_LOG_BATCH;
        $page = 0;
        $count = 0;
        $total = intval($this->logRepository->fetchUserActionsList($allFilters, true));

        // Prepare CSV file
        $handle = fopen('php://output', 'w+');
        fputcsv($handle, [
            $this->translator->trans('user', [], 'platform'),
            $this->translator->trans('actions', [], 'platform'),
        ], ';', '"');

        // Get batched logs
        while ($count === 0 || $count < $total) {
            $logs = $logs = $this->logRepository->fetchUsersByActionsList($allFilters, false, $page, $limit, $sortBy);
            $count += self::CSV_LOG_BATCH;
            ++$page;

            foreach ($logs as $log) {
                fputcsv($handle, [
                    $log['doerLastName'].' '.$log['doerFirstName'],
                    $log['actions'],
                ], ';', '"');
            }
        }

        fclose($handle);

        return $handle;
    }
public function exportUserActionToCsv ( array $ finderParams = [ ] ) { // Initialize variables $ queryParams = FinderProvider :: parseQueryParams ( $ finderParams ) ; $ allFilters = $ queryParams [ 'allFilters' ] ; $ sortBy = $ queryParams [ 'sortBy' ] ; $ limit = self :: CSV_LOG_BATCH ; $ page = 0 ; $ count = 0 ; $ total = intval ( $ this -> logRepository -> fetchUserActionsList ( $ allFilters , true ) ) ; // Prepare CSV file $ handle = fopen ( 'php://output' , 'w+' ) ; fputcsv ( $ handle , [ $ this -> translator -> trans ( 'user' , [ ] , 'platform' ) , $ this -> translator -> trans ( 'actions' , [ ] , 'platform' ) , ] , ';' , '"' ) ; // Get batched logs while ( $ count === 0 || $ count < $ total ) { $ logs = $ logs = $ this -> logRepository -> fetchUsersByActionsList ( $ allFilters , false , $ page , $ limit , $ sortBy ) ; $ count += self :: CSV_LOG_BATCH ; ++ $ page ; foreach ( $ logs as $ log ) { fputcsv ( $ handle , [ $ log [ 'doerLastName' ] . ' ' . $ log [ 'doerFirstName' ] , $ log [ 'actions' ] , ] , ';' , '"' ) ; } } fclose ( $ handle ) ; return $ handle ; }
Exports users' actions for a given query.

@param array $finderParams

@return bool|resource
Exports users actions for a given query .