Documentation

目次

前のトピックへ

< Class Phalcon\Paginator\Adapter\NativeArray

次のトピックへ

Class Phalcon\Paginator\Exception >

このページ

Class Phalcon\Paginator\Adapter\QueryBuilder

implements Phalcon\Paginator\AdapterInterface

Pagination using a PHQL query builder as source of data

<?php

  $builder = $this->modelsManager->createBuilder()
                   ->columns('id, name')
                   ->from('Robots')
                   ->orderBy('name');

  $paginator = new Phalcon\Paginator\Adapter\QueryBuilder(array(
      "builder" => $builder,
      "limit"=> 20,
      "page" => 1
  ));

Methods

public __construct (array $config)

public setCurrentPage (unknown $currentPage)

Set the current page number

public stdClass getPaginate ()

Returns a slice of the resultset to show in the pagination