public function getActivity($log, $page = 1, $amount = 10, $options = [])
    {
        if ($log == 'change') {
            $repo = $this->changeRepository;
        } elseif ($log == 'system') {
            $repo = $this->systemRepository;
        } else {
            throw new \UnexpectedValueException("Invalid log type requested: $log");
        }

        try {
            $rows = $repo->getActivity($page, $amount, $options);
            $rowcount = $repo->getActivityCount($options);
        } catch (TableNotFoundException $e) {
            return null;
        }

        // Set up the pager

        /** @var \Bolt\Pager\PagerManager $manager */
        $manager = $this->app['pager'];
        $manager->createPager('activity')
            ->setCount($rowcount)
            ->setTotalpages(ceil($rowcount / $amount))
            ->setCurrent($page)
            ->setShowingFrom(($page - 1) * $amount + 1)
            ->setShowingTo(($page - 1) * $amount + count($rows));

        return $rows;
    }
public function getActivity($log, $page = 1, $amount = 10, $options = [])
    {
        if ($log == 'change') {
            $repo = $this->changeRepository;
        } elseif ($log == 'system') {
            $repo = $this->systemRepository;
        } else {
            throw new \UnexpectedValueException("Invalid log type requested: $log");
        }

        try {
            $rows = $repo->getActivity($page, $amount, $options);
            $rowcount = $repo->getActivityCount($options);
        } catch (TableNotFoundException $e) {
            return null;
        }

        // Set up the pager

        /** @var \Bolt\Pager\PagerManager $manager */
        $manager = $this->app['pager'];
        $manager->createPager('activity')
            ->setCount($rowcount)
            ->setTotalpages(ceil($rowcount / $amount))
            ->setCurrent($page)
            ->setShowingFrom(($page - 1) * $amount + 1)
            ->setShowingTo(($page - 1) * $amount + count($rows));

        return $rows;
    }
public function getActivity ( $ log , $ page = 1 , $ amount = 10 , $ options = [ ] ) { if ( $ log == 'change' ) { $ repo = $ this -> changeRepository ; } elseif ( $ log == 'system' ) { $ repo = $ this -> systemRepository ; } else { throw new \ UnexpectedValueException ( "Invalid log type requested: $log" ) ; } try { $ rows = $ repo -> getActivity ( $ page , $ amount , $ options ) ; $ rowcount = $ repo -> getActivityCount ( $ options ) ; } catch ( TableNotFoundException $ e ) { return null ; } // Set up the pager /** @var \Bolt\Pager\PagerManager $manager */ $ manager = $ this -> app [ 'pager' ] ; $ manager -> createPager ( 'activity' ) -> setCount ( $ rowcount ) -> setTotalpages ( ceil ( $ rowcount / $ amount ) ) -> setCurrent ( $ page ) -> setShowingFrom ( ( $ page - 1 ) * $ amount + 1 ) -> setShowingTo ( ( $ page - 1 ) * $ amount + count ( $ rows ) ) ; return $ rows ; }
Get a specific activity log.

@param string $log     The log to query.  Either 'change' or 'system'
@param int    $page
@param int    $amount  Number of results to return
@param array  $options

@throws \UnexpectedValueException

@return array
Get a specific activity log .