class Illuminate / Pagination / AbstractCursorPaginator
abstract

AbstractCursorPaginator

Implements

Uses

Properties

protected

$items Illuminate\...\Collection

All of the items being paginated.

Default: null
protected

$perPage int

The number of items to be shown per page.

Default: null
protected

$path string

The base path to assign to all URLs.

Default: '/'
protected

$query array

The query parameters to add to all URLs.

Default: []
protected

$fragment string|null

The URL fragment to add to all URLs.

Default: null
protected

$cursorName string

The cursor string variable used to store the page.

Default: 'cursor'
protected

$cursor Cursor |null

The current cursor.

Default: null
protected

$parameters array

The paginator parameters for the cursor.

Default: null
protected

$options array

The paginator options.

Default: null
protected static

$currentCursorResolver Closure

The current cursor resolver callback.

Default: null

Methods

public

url ( $cursor ) : string

Get the URL for a given cursor.

Parameters

public

previousPageUrl ( ) : string|null

Get the URL for the previous page.

public

nextPageUrl ( ) : string|null

The URL for the next page, or null.

public

previousCursor ( ) : Cursor |null

Get the "cursor" that points to the previous set of items.

public

nextCursor ( ) : Cursor |null

Get the "cursor" that points to the next set of items.

public

getCursorForItem ( $item , $isNext ) : Cursor

Get a cursor instance for the given item.

Parameters

public

getParametersForItem ( $item ) : array

Get the cursor parameters for a given object.

Parameters

protected

getPivotParameterForItem ( $item , $parameterName ) : string|null

Get the cursor parameter value from a pivot model if applicable.

Parameters

protected

ensureParameterIsPrimitive ( $parameter ) : mixed

Ensure the parameter is a primitive type.

Parameters

  • $parameter mixed
public

fragment ( $fragment ) : $this|string|null

Get / set the URL fragment to be appended to URLs.

Parameters

  • $fragment string|null
public

appends ( $key , $value ) : $this

Add a set of query string values to the paginator.

Parameters

  • $key array|string|null
  • $value string|null
protected

appendArray ( array $keys ) : $this

Add an array of query string values.

Parameters

  • $keys array
public

withQueryString ( ) : $this

Add all current query string values to the paginator.

protected

addQuery ( $key , $value ) : $this

Add a query string value to the paginator.

Parameters

  • $key string
  • $value string
protected

buildFragment ( ) : string

Build the full fragment portion of a URL.

public

loadMorph ( $relation , $relations ) : $this

Load a set of relationships onto the mixed relationship collection.

Parameters

  • $relation string
  • $relations array
public

loadMorphCount ( $relation , $relations ) : $this

Load a set of relationship counts onto the mixed relationship collection.

Parameters

  • $relation string
  • $relations array
public

items ( ) : array

Get the slice of items being paginated.

public

through ( callable $callback ) : $this

Transform each item in the slice of items using a callback.

Parameters

  • $callback callable
public

perPage ( ) : int

Get the number of items shown per page.

public

cursor ( ) : Cursor |null

Get the current cursor being paginated.

public

getCursorName ( ) : string

Get the query string variable used to store the cursor.

public

setCursorName ( $name ) : $this

Set the query string variable used to store the cursor.

Parameters

  • $name string
public

withPath ( $path ) : $this

Set the base path to assign to all URLs.

Parameters

  • $path string
public

setPath ( $path ) : $this

Set the base path to assign to all URLs.

Parameters

  • $path string
public

path ( ) : string|null

Get the base path for paginator generated URLs.

public static

resolveCurrentCursor ( $cursorName , $default ) : Cursor |null

Resolve the current cursor or return the default value.

Parameters

  • $cursorName string
public static

currentCursorResolver ( Closure $resolver ) : void

Set the current cursor resolver callback.

Parameters

public static

viewFactory ( ) : Factory

Get an instance of the view factory from the resolver.

public

getIterator ( ) : ArrayIterator

Get an iterator for the items.

public

isEmpty ( ) : bool

Determine if the list of items is empty.

public

isNotEmpty ( ) : bool

Determine if the list of items is not empty.

public

count ( ) : int

Get the number of items for the current page.

public

getCollection ( ) : Illuminate\...\Collection

Get the paginator's underlying collection.

public

setCollection ( Illuminate\...\Collection $collection ) : $this

Set the paginator's underlying collection.

Parameters

  • $collection Illuminate\...\Collection
public

getOptions ( ) : array

Get the paginator options.

public

offsetExists ( $key ) : bool

Determine if the given item exists.

Parameters

  • $key mixed
public

offsetGet ( $key ) : mixed

Get the item at the given offset.

Parameters

  • $key mixed
public

offsetSet ( $key , $value ) : void

Set the item at the given offset.

Parameters

  • $key mixed
  • $value mixed
public

offsetUnset ( $key ) : void

Unset the item at the given key.

Parameters

  • $key mixed
public

toHtml ( ) : string

Render the contents of the paginator to HTML.

public

__call ( $method , $parameters ) : mixed

Make dynamic calls into the collection.

Parameters

  • $method string
  • $parameters array
public

__toString ( ) : string

Render the contents of the paginator when casting to a string.