ExportData Class Reference
Constructor & Destructor Documentation
__construct |
( |
$ |
page_id = 0 |
) |
|
Constructor
- Parameters:
-
| mixed | $page_id (Optional) Defaults to 0. |
Member Function Documentation
Add (or Set) data to the current record
- Parameters:
-
| string | $key |
| string | $value |
- Returns:
- $this
Implements ExportDataInterface.
find |
( |
$ |
value, |
|
|
$ |
key = NULL , |
|
|
$ |
results = 1 , |
|
|
$ |
direction = 0 | |
|
) |
| | |
Find a value in the dataset of the current page
- Parameters:
-
| mixed | $value |
| mixed | $key (Optional) Defaults to NULL. Set this to constrain the search by key. |
| int | $results (Optional) Defaults to 1. The number of results to return. Enter 0 for no limit. |
| int | $direction (Optional) Defaults to 0. 0 to search from beginning, 1 to search backward from end. |
- Returns:
- array
- Keys are the pointers.
- Values are an array of fields in the current pointer
Implements ExportDataInterface.
getCurrent |
( |
$ |
key = NULL |
) |
|
Return the current record or data by key
- Parameters:
-
| string | $key (Optional) Defaults to NULL. If excluded the entire current record will be returned. If included the value of the current row at $key will be returned. |
- Returns:
- array | mixed
Implements ExportDataInterface.
getKeys |
( |
$ |
page_id = NULL |
) |
|
Return an array of all keys for current of specified page
- Returns:
- array
Implements ExportDataInterface.
Return an array of location data keyed by location_id
- Returns:
- array
- keys are location_ids
- values: arrays
Implements ExportDataInterface.
gotoLocation |
( |
$ |
location_id |
) |
|
Goto to a stored location
- Parameters:
-
| string | $location_id A unique key or preset id to remember this location by. If nothing has been stored using this id, nothing happens. |
- Returns:
- $this
Implements ExportDataInterface.
Returns the record index and advances the record pointer
- Returns:
- int The index of the record that was just closed
Implements ExportDataInterface.
normalize |
( |
$ |
empty_value |
) |
|
Normalize all rows so that they all contain the same number of columns, the column order will be taken from the order of the first column
- Parameters:
-
| array|mixed | $empty_value If this is an array then you may provide default values by column key, as well as the special key `default` which is the default value for any column whose key is not present in $empty_value. If this is not an array, then the value will be used for all empty values of all columns, rows, cells, etc. |
- Returns:
- $this
Implements ExportDataInterface.
Set the data key order for the current page
- Parameters:
-
| array|mixed | $key
- If this is an array, it will be taken as the key order
- Or, you can list individual keys in correct order as function arguments
|
- Returns:
- $this
Implements ExportDataInterface.
setLocations |
( |
$ |
locations |
) |
|
Set the current page
It's possible to store multiple pages or grids in one object, use this to designate the current page to write data to.
- Parameters:
-
- Returns:
- $this
Implements ExportDataInterface.
setPageOrder |
( |
$ |
page_id |
) |
|
Set the order the pages appear in the data array
- Parameters:
-
| string | $page_id Enter all page_ids in correct order as function arguments |
- Returns:
- $this
Implements ExportDataInterface.
setPointer |
( |
$ |
index = NULL |
) |
|
Advance the record pointer to a given index or all the way to the end
- Parameters:
-
| int|NULL | $index (Optional) Defaults to NULL. When NULL the pointer will move to the end to begin a new row of data. |
- Returns:
- $this
Implements ExportDataInterface.
storeLocation |
( |
$ |
location_id |
) |
|
Store the current page and pointer location for later resuming
- Parameters:
-
| string | $location_id A unique key or preset id to remember this location by. |
- Returns:
- $this
Implements ExportDataInterface.
Field Documentation
$current_page = 0 [protected] |
$current_pointers = array() [protected] |
$data = array() [protected] |
$keys = array() [protected] |
$locations = array() [protected] |
The documentation for this class was generated from the following file: