public function getUsersAction(ParamFetcherInterface $paramFetcher)
    {
        $supporedCriteria = [
            'enabled' => '',
        ];

        $page = $paramFetcher->get('page');
        $limit = $paramFetcher->get('count');
        $sort = $paramFetcher->get('orderBy');
        $criteria = array_intersect_key($paramFetcher->all(), $supporedCriteria);

        foreach ($criteria as $key => $value) {
            if (null === $value) {
                unset($criteria[$key]);
            }
        }

        if (!$sort) {
            $sort = [];
        } elseif (!\is_array($sort)) {
            $sort = [$sort, 'asc'];
        }

        return $this->userManager->getPager($criteria, $page, $limit, $sort);
    }
public function getUsersAction(ParamFetcherInterface $paramFetcher)
    {
        $supporedCriteria = [
            'enabled' => '',
        ];

        $page = $paramFetcher->get('page');
        $limit = $paramFetcher->get('count');
        $sort = $paramFetcher->get('orderBy');
        $criteria = array_intersect_key($paramFetcher->all(), $supporedCriteria);

        foreach ($criteria as $key => $value) {
            if (null === $value) {
                unset($criteria[$key]);
            }
        }

        if (!$sort) {
            $sort = [];
        } elseif (!\is_array($sort)) {
            $sort = [$sort, 'asc'];
        }

        return $this->userManager->getPager($criteria, $page, $limit, $sort);
    }
public function getUsersAction ( ParamFetcherInterface $ paramFetcher ) { $ supporedCriteria = [ 'enabled' => '' , ] ; $ page = $ paramFetcher -> get ( 'page' ) ; $ limit = $ paramFetcher -> get ( 'count' ) ; $ sort = $ paramFetcher -> get ( 'orderBy' ) ; $ criteria = array_intersect_key ( $ paramFetcher -> all ( ) , $ supporedCriteria ) ; foreach ( $ criteria as $ key => $ value ) { if ( null === $ value ) { unset ( $ criteria [ $ key ] ) ; } } if ( ! $ sort ) { $ sort = [ ] ; } elseif ( ! \ is_array ( $ sort ) ) { $ sort = [ $ sort , 'asc' ] ; } return $ this -> userManager -> getPager ( $ criteria , $ page , $ limit , $ sort ) ; }
Returns a paginated list of users.

@ApiDoc(
resource=true,
output={"class"="Sonata\DatagridBundle\Pager\PagerInterface", "groups"={"sonata_api_read"}}
)

@QueryParam(name="page", requirements="\d+", default="1", description="Page for users list pagination (1-indexed)")
@QueryParam(name="count", requirements="\d+", default="10", description="Number of users by page")
@QueryParam(name="orderBy", map=true, requirements="ASC|DESC", nullable=true, strict=true, description="Query users order by clause (key is field, value is direction")
@QueryParam(name="enabled", requirements="0|1", nullable=true, strict=true, description="Enabled/disabled users only?")

@View(serializerGroups={"sonata_api_read"}, serializerEnableMaxDepthChecks=true)

@param ParamFetcherInterface $paramFetcher

@return PagerInterface
Returns a paginated list of users .