Get users.

@param int $perPage
@return int|mixed
972724
public function getUsers($perPage = 15)
    {
        $directory = Google::make('directory');
        try {
            $r = $directory->users->listUsers([
                'domain' => config('users.google_apps_domain'),
                'maxResults' => $perPage
            ]);
        } catch (\Exception $e) {
            return json_decode($e->getMessage());
        }

        return $r->users;
    }
633003
public function getPublishedOrderedChildren($perPage = null)
    {
        $children = $this->children()
            ->published();

        $this->determineChildrenSorting($children);

        return $this->determineChildrenPagination($perPage, $children);
    }
1321631
public function getTemplatesAsync($page = null, $per_page = null)
    {
        return $this->getTemplatesAsyncWithHttpInfo($page, $per_page)
            ->then(
                function ($response) {
                    return $response[0];
                }
            );
    }
574437
public function paginate($perPage = null, $columns = ['*'], $pageName = 'page', $page = null)
    {
        $this->parse();

        return $this->getHandler()->paginate($this->input('limit', $perPage), $this->getColumns($columns), $this->config('prefix', '').$pageName, $page);
    }
532630
public function forPage(int $page, int $perPage): CollectionInterface
    {
        $page--;
        $offset = $page * $perPage;

        return $this->slice($offset, $perPage);
    }
1225562
public function paginate($perPage = 20)
    {
        $page = request()->get('page', 1);
        $path = request()->url();

        return new LengthAwarePaginator(
            $this->forPage($page, $perPage),
            $this->count(),
            $perPage,
            $page,
            compact('path')
        );
    }
937521
public function paginate($perPage = 15, $columns = array('*'))
	{
		$paginator = $this->connection->getPaginator();

		if (isset($this->groups))
		{
			return $this->groupedPaginate($paginator, $perPage, $columns);
		}
		else
		{
			return $this->ungroupedPaginate($paginator, $perPage, $columns);
		}
	}
607615
public function paginate($page, $perPage = null)
    {
        if ($page < 1) {
            $page = 1;
        }
        
        $paginator = new Paginator($this->select, $this->adapter());
        $items     = $paginator->getItems(($page - 1) * $perPage, $perPage);
        
        return $items->toArray();
    }
1306712
public static function get_entries($filters = array(), $page = 0, $perpage = 10) {
        global $PAGE;

        $warnings = array();
        $params = self::validate_parameters(self::get_entries_parameters(),
            array('filters' => $filters, 'page' => $page, 'perpage' => $perpage));

        list($context, $filters, $courseid, $userid) = self::validate_access_and_filters($params['filters']);

        $PAGE->set_context($context); // Needed by internal APIs.
        $output = $PAGE->get_renderer('core');

        // Get filters.
        $blogheaders = blog_get_headers($filters['courseid'], $filters['groupid'], $filters['userid'], $filters['tagid'],
            $filters['tag'], $filters['cmid'], $filters['entryid'], $filters['search']);
        $bloglisting = new \blog_listing($blogheaders['filters']);

        $page  = $params['page'];
        $limit = empty($params['perpage']) ? get_user_preferences('blogpagesize', 10) : $params['perpage'];
        $start = $page * $limit;
        $entries = $bloglisting->get_entries($start, $limit);
        $totalentries = $bloglisting->count_entries();

        $exportedentries = array();
        foreach ($entries as $entry) {
            $exporter = new post_exporter($entry, array('context' => $context));
            $exportedentries[] = $exporter->export($output);
        }
        return array(
            'warnings' => $warnings,
            'entries' => $exportedentries,
            'totalentries' => $totalentries,
        );
    }
1325919
public function paginate($page, $perPage = null)
    {
        $page = (int)$page;
        if ($page < 1) {
            $page = 1;
        }
        
        if ($perPage === null) {
            if (!$perPage = $this->select->getRawState('limit')) {
                throw new Exception\InvalidArgumentException(
                    "No per page passed and no limit is set"
                );
            }
        }
        
        $modelClass = $this->modelClass;
        $paginator  = new Paginator($this->select, $modelClass::adapter());
        $items      = $paginator->getItems(($page - 1) * $perPage, $perPage);
        $collection = $this->buildCollection($items->toArray());
        
        $collection->setPage($page);
        $collection->setPerPage($perPage);
        $collection->setPaginator($paginator);
        
        return $collection;
    }
1235636
public function paginate($perPage = 50, $currentPage = 0, $isCritical = true)
    {
        $this->paginated = true;

        $pages = [];

        $cookie = '';

        do {
            $this->connection->controlPagedResult($perPage, $isCritical, $cookie);

            // Run the search.
            $resource = @$this->connection->search($this->getDn(), $this->getQuery(), $this->getSelects());

            if ($resource) {
                $this->connection->controlPagedResultResponse($resource, $cookie);

                // We'll collect each resource result into the pages array.
                $pages[] = $resource;
            }
        } while (! empty($cookie));

        $paginator = $this->newProcessor()->processPaginated($pages, $perPage, $currentPage);

        // Reset paged result on the current connection. We won't pass in the current $perPage
        // parameter since we want to reset the page size to the default '1000'. Sending '0'
        // eliminates any further opportunity for running queries in the same request,
        // even though that is supposed to be the correct usage.
        $this->connection->controlPagedResult();

        return $paginator;
    }
977971
public function getLogs($page = 1, $perPage = 20)
    {
        return $this->getUser()->post(
            'source/log',
            array('id' => $this->getId(), 'page' => $page, 'per_page' => $perPage)
        );
    }
546625
public static function all($page = 1, $per_page = 10)
    {
        $collections = self::get(
            "/collections",
            ['query' => ['page' => $page, 'per_page' => $per_page]]
        );

        $collectionsArray = self::getArray($collections->getBody(), get_called_class());

        return new ArrayObject($collectionsArray, $collections->getHeaders());
    }
818578
public static function page($total, $perPage)
        {
            $page = (null === request()->getCrudNumPage()) ? 1 : request()->getCrudNumPage();

            // The page will be validated and adjusted if it is less than one or greater
            // than the last page. For example, if the current page is not an integer or
            // less than one, one will be returned. If the current page is greater than
            // the last page, the last page will be returned.
            if (is_numeric($page) && $page > $last = ceil($total / $perPage)) {
                return ($last > 0) ? $last : 1;
            }

            return (static::valid($page)) ? $page : 1;
        }
776159
public function getAll($identity, $page = 1, $perPage = 25)
    {
        $params = array(
            'page' => $page,
            'per_page' => $perPage
        );

        return $this->_user->get('account/identity/' . $identity . '/token', $params);
    }
206344
public function listSubAccounts($per_page,$page){

        $this->setRequestOptions();
        return $this->setHttpResponse("/subaccount/?perPage=".(int) $per_page."&page=".(int) $page,"GET")->getResponse();

    }
1072895
public function forPage($page, $perPage = 15)
	{
		if( $page < 1 )
		{
			$page = 1;
		}
		return $this->limit($perPage, ($page - 1) * $perPage);
	}