Ojs\ApiBundle\Controller\Admin\PeriodRestController::getPeriodsAction PHP Method

getPeriodsAction() public method

List all Periods.
public getPeriodsAction ( Request $request, FOS\RestBundle\Request\ParamFetcherInterface $paramFetcher ) : array
$request Symfony\Component\HttpFoundation\Request the request object
$paramFetcher FOS\RestBundle\Request\ParamFetcherInterface param fetcher service
return array
    public function getPeriodsAction(Request $request, ParamFetcherInterface $paramFetcher)
    {
        if (!$this->isGranted('VIEW', new Period())) {
            throw new AccessDeniedException();
        }
        $offset = $paramFetcher->get('offset');
        $offset = null === $offset ? 0 : $offset;
        $limit = $paramFetcher->get('limit');
        return $this->container->get('ojs_api.period.handler')->all($limit, $offset);
    }