Find al ProductOrderItems with pagination options.
@param  integer $page [description]
@param  integer $max [description]
@return ArrayCollection        ProductOrderItems.
350300
public function findAll($page = 1, $max = 50)
    {
        $offset = (($page - 1) * $max);
        $productOrderItems = $this->productOrderItemRepository->findBy(array(), array(), $max, $offset);
        return $productOrderItems;
    }
1307992
public function getByPage(
        int $page = 1,
        int $limit = 10,
        array $where = [],
        array $with = [],
        string $orderBy = null,
        string $order = 'desc'
    ) {
        $query = $this->make($with);

        $query = $this->applyWhere($query, $where);

        if ($orderBy) {
            $query = $query->orderBy($orderBy, $order);
        }

        return $query->skip($limit * ($page - 1))
            ->take($limit)
            ->get();
    }
522577
public function findAllWithoutFetchPaged($page = 0, $limit = 20) {
    $offset = $page * $limit;
    $results = $this->createQuery()
      ->setFirstResult($offset)
      ->setMaxResults($limit)
      ->execute();
    return $results;
  }
505137
public function findByCollector($collector, $page, $maxItemPerPage)
    {
        $query = $this
            ->createQueryBuilder('c')
            ->where('c.collector = :collector')
            ->setParameter('collector', $collector)
            ->getQuery()
        ;

        $paginator = new Paginator($query);
        $paginator
            ->getQuery()
            ->setFirstResult($maxItemPerPage * ($page - 1))
            ->setMaxResults($maxItemPerPage)
        ;

        return $paginator;
    }
595956
public function paginate($page = 1, $perPage = 15)
    {
        if ($this->paginatorCreator) {
            return call_user_func($this->paginatorCreator, $page, $perPage);
        }

        $all = iterator_to_array($this->getIterator());

        return array_slice($all, ($page-1)*$perPage, $perPage);
    }
1035010
public function transform($events, $eventsCount, $page, $maxPerPage)
    {
        $pageCount = count($events);
        $eventsCollection = new EventCollectionObjectRepresentation(
            (int) $page,
            (int) $maxPerPage,
            (int) $numberOfPages = ceil($eventsCount/$maxPerPage),
            (int) $eventsCount,
            $this->calculateLinks($page, $numberOfPages)
        );
        foreach ($events as $event) {
            $eventsCollection->addEvent(new EventObjectRepresentation($event));
        }

        $response = new Response(
            $this->serializer->serialize(
                [
                    $eventsCollection
                ], 'xml'),
            $this->getHttpStatusCode($pageCount)
        );

        $response->headers->set('Content-type', 'text/xml');
        $response->setCharset('utf-8');

        // set infinite cache if page is complete
        if ($maxPerPage === $pageCount) {
            $response
                ->setMaxAge(60 * 60 * 24 * 365)
                ->setSharedMaxAge(60 * 60 * 24 * 365);
        }

        return $response;
    }
620854
public function findAllCurrent($limit = 1000, $page = 1)
    {
        try {
            $qb = $this->getValidSpecialPriceQuery();

            $adapter = new DoctrineORMAdapter($qb);
            $pagerfanta = new Pagerfanta($adapter);
            $pagerfanta->setMaxPerPage($limit);
            $pagerfanta->setCurrentPage($page);

            return $pagerfanta;
        } catch (NoResultException $exc) {
            return null;
        }
    }
882149
public function paginate($page = 1, $maxPerPage = 10)
    {
        $this
            ->setLimit($maxPerPage)
            ->setOffset(($page - 1) * $maxPerPage);

        $pager = $this->find();
        $pager->setPage($page);
        $pager->setMaxPerPage($maxPerPage);

        return $pager;
    }
530748
function page($page, $limit = null, $offset = 0) {
		if ($page === null || $limit === null) {
			// retrieve all rows
			$this->num(':offset', $offset);
			$this->num(':count', PHP_INT_MAX);
		}
		else { // $page != null
			$this->num(':offset', $limit * ($page - 1) + $offset);
			$this->num(':count', $limit);
		}

		return $this;
	}
893789
public function userWorkspaceListAction(User $user, $page, $max)
    {
        $pager = $this->workspaceManager->getOpenableWorkspacesByRolesPager($user->getRoles(), $page, $max);

        return array('user' => $user, 'pager' => $pager, 'page' => $page, 'max' => $max);
    }
1235193
public function getUsersByRolesIncludingGroups(
        array $roles,
        $page = 1,
        $max = 20,
        $executeQuery = true
    )
    {
        $users = $this->userRepo
            ->findUsersByRolesIncludingGroups($roles, $executeQuery);

        return $this->pagerFactory->createPagerFromArray($users, $page, $max);
    }
566804
public function findAll(
        $page = 1,
        $per_page = 20,
        $order_by = self::ORDERBY_CREATED_AT,
        $order_dir = self::ORDERDIR_ASC
    ) {
        $results = self::getAll($this->_user, $page, $per_page, $order_by, $order_dir);

        if (isset($results['subscriptions'])) { // Cope with pagination
            $results = $results['subscriptions'];
        }

        $retval = array();

        foreach ($results as $pylon) {
            $retval[] = new self($this->_user, $pylon);
        }

        return $retval;
    }
1132027
public function getDisplayableWorkspacesBySearchPager($search, $page, $max = 20)
    {
        $workspaces = $this->workspaceRepo->findDisplayableWorkspacesBySearch($search);

        return $this->pagerFactory->createPagerFromArray($workspaces, $page, $max);
    }
485098
public function paginate($page, $perPage = null)
    {
        $this->queryDefaults['paged'] = $page;
        $this->queryDefaults['posts_per_page'] = $perPage ?: get_option('posts_per_page');

        return $this;
    }
976499
public function getByPage($page = 1, $limit = 10, $with = array())
    {
        $result = new StdClass;
        $result->page = $page;
        $result->limit = $limit;
        $result->totalItems = 0;
        $result->items = array();

        $query = $this->make($with);
        $users = $query->skip($limit * ($page - 1))
            ->take($limit)
            ->get();
        $result->totalItems = $this->model->count();
        $result->items = $users->all();

        return $result;
    }
1070235
public function getUsersByRoles(array $roles, $page = 1, $max = 20)
    {
        $res = $this->userRepo->findByRoles($roles, true);

        return $this->pagerFactory->createPager($res, $page, $max);
    }
658051
private function get_products( $page ) {
		$products = array();

		foreach ( $this->settings as $setting ) {
			$products = array_merge( $products, $setting->get_products( $page ) );
		}

		return $products;
	}