GravityView
2.17
The best, easiest way to display Gravity Forms entries on your website.
|
If this file is called directly, abort. More...
Public Member Functions | |
add ( $entry) | |
Add an to this collection. More... | |
add_count_callback ( $callback) | |
Defer counting of data to the provided callable. More... | |
add_fetch_callback ( $callback) | |
Defer fetching of data to the provided callable. More... | |
all () | |
Get the entries as an array. More... | |
clear () | |
fetch () | |
Hydrate this collection now. More... | |
filter (\GV\Entry_Filter $filter) | |
Apply a filter to the current collection. More... | |
first () | |
Get the first in this collection. More... | |
get ( $entry_id, $backend='gravityforms') | |
Get a from this list. More... | |
last () | |
Get the last in this collection. More... | |
limit ( $limit) | |
Limit the fetch to a specified window. More... | |
offset ( $offset) | |
Add an $offset to these entries. More... | |
page ( $page) | |
Set the current page. More... | |
pluck ( $key) | |
Pluck by key. More... | |
sort ( $sort) | |
Sort. More... | |
total () | |
Count the total number of objects that are possible to get. More... | |
Public Member Functions inherited from Collection | |
add ( $value) | |
Add an object to this collection. More... | |
all () | |
Returns all the objects in this collection as an an array. More... | |
clear () | |
Clear this collection. More... | |
count () | |
Returns the count of the objects in this collection. More... | |
first () | |
Get the first added object. More... | |
last () | |
Get the last added object. More... | |
merge (\GV\Collection $collection) | |
Merge another collection into here. More... | |
Data Fields | |
$current_page = 1 | |
$filters = array() | |
$limit = 20 | |
$offset = 0 | |
$sorts = array() | |
Private Member Functions | |
add_callback ( $type, $callback) | |
Add a callback for lazy loading/counting. More... | |
Private Attributes | |
$callbacks = array() | |
$fetched = -1 | |
If this file is called directly, abort.
A collection of objects.
Definition at line 12 of file class-gv-collection-entry.php.
add | ( | $entry | ) |
Add an to this collection.
\GV\Entry | $entry | The entry to add to the internal array. |
Definition at line 64 of file class-gv-collection-entry.php.
References $entry, and gravityview().
|
private |
Add a callback for lazy loading/counting.
callable | $callback | The callback to call when needed. |
Definition at line 364 of file class-gv-collection-entry.php.
add_count_callback | ( | $callback | ) |
Defer counting of data to the provided callable.
The callback signature should be as follows: int callback( $filter );
The methods that trigger the callback are:
callable | $callback | The callback to call when needed. |
Definition at line 353 of file class-gv-collection-entry.php.
add_fetch_callback | ( | $callback | ) |
Defer fetching of data to the provided callable.
The callback signature should be as follows: callback( $filter, $sort, $offset );
The methods that trigger the callback are:
::fetch is triggered via:
callable | $callback | The callback to call when needed. |
Definition at line 333 of file class-gv-collection-entry.php.
all | ( | ) |
Get the entries as an array.
Definition at line 129 of file class-gv-collection-entry.php.
clear | ( | ) |
Definition at line 375 of file class-gv-collection-entry.php.
fetch | ( | ) |
Hydrate this collection now.
Calculate the offsets.
Call all lazy callbacks.
Definition at line 195 of file class-gv-collection-entry.php.
References GV\$i.
filter | ( | \GV\Entry_Filter | $filter | ) |
Apply a filter to the current collection.
This operation is non-destructive as a copy of the collection is returned.
\GV\Entry_Filter | $filter | The filter to be applied. |
Definition at line 233 of file class-gv-collection-entry.php.
first | ( | ) |
Get the first in this collection.
Definition at line 180 of file class-gv-collection-entry.php.
get | ( | $entry_id, | |
$backend = 'gravityforms' |
|||
) |
Get a from this list.
int | $entry_id | The ID of the entry to get. |
string | $backend | The form backend identifier, allows for multiple form backends in the future. Unused until then. |
Definition at line 85 of file class-gv-collection-entry.php.
References $entry.
last | ( | ) |
Get the last in this collection.
Definition at line 165 of file class-gv-collection-entry.php.
int The limit | ( | $limit | ) |
Limit the fetch to a specified window.
int | $limit | The limit. |
Definition at line 271 of file class-gv-collection-entry.php.
int The offset | ( | $offset | ) |
Add an $offset to these entries.
Useful, you know, for pagination and stuff. Not too useful directly.
int | $offset | The number of entries to skip in the database. |
Definition at line 292 of file class-gv-collection-entry.php.
int The current page | ( | $page | ) |
Set the current page.
int | $page | Set the current page to this page. Ends up agumenting the $offset in |
Definition at line 306 of file class-gv-collection-entry.php.
pluck | ( | $key | ) |
Pluck by key.
string | $key | The key to pluck by. |
Definition at line 146 of file class-gv-collection-entry.php.
References $entry.
sort | ( | $sort | ) |
Sort.
\GV\Entry_Sort | $sort | The sort to apply to this collection. |
Definition at line 252 of file class-gv-collection-entry.php.
total | ( | ) |
Count the total number of objects that are possible to get.
Call all lazy callbacks.
Definition at line 102 of file class-gv-collection-entry.php.
|
private |
Definition at line 23 of file class-gv-collection-entry.php.
$current_page = 1 |
Definition at line 48 of file class-gv-collection-entry.php.
|
private |
Definition at line 53 of file class-gv-collection-entry.php.
$filters = array() |
Definition at line 28 of file class-gv-collection-entry.php.
$limit = 20 |
Definition at line 43 of file class-gv-collection-entry.php.
$offset = 0 |
Definition at line 38 of file class-gv-collection-entry.php.
$sorts = array() |
Definition at line 33 of file class-gv-collection-entry.php.