atkDataNode __construct(
[string
$type = ''], [int
$flags = 0]
)
|
|
Constructor.
Parameters:
|
string |
$type: |
node type (by default the class name) |
|
int |
$flags: |
node flags |
API Tags:
Add is not supported.
API Tags:
| Return: | false |
| Access: | public |
Redefinition of:
- atkNode::addDb()
- Save a new record to the database.
int countData(
[array
$params = array()]
)
|
|
Count "rows".
Supported parameters are: selector, limit, offset and order.
Parameters:
|
array |
$params: |
parameters |
API Tags:
| Return: | number of "records" |
| Access: | protected |
int countDb(
[string
$selector = null]
)
|
|
Returns how many records will be returned for the given selector.
Parameters:
|
string |
$selector: |
selector string |
API Tags:
| Return: | record count |
| Access: | public |
Delete is not supported.
API Tags:
| Return: | false |
| Access: | public |
Redefinition of:
- atkNode::deleteDb()
- Delete record(s) from the database.
data filterColumns(
array
$data
)
|
|
Filter invalid columns.
Parameters:
API Tags:
array filterData(
array
$data, array
$criteria, array
$search
)
|
|
Filter data using the given selector.
Parameters:
|
array |
$data: |
data list |
|
array |
$criteria: |
selector criteria list |
|
array |
$search: |
search fields / values |
API Tags:
| Return: | filtered data |
| Access: | protected |
array findData(
[array
$params = array()]
)
|
|
Find data using the given parameters.
Supported parameters are: selector, limit, offset and order.
Parameters:
|
array |
$params: |
parameters |
API Tags:
| Return: | found data |
| Access: | protected |
array getCriteria(
string
$selector
)
|
|
Translate the given selector to a criteria array which key/values can be used to filter data.
Parameters:
|
string |
$selector: |
selector string |
API Tags:
| Return: | criteria |
| Access: | protected |
array getData(
[array
$criteria = null]
)
|
|
Returns the internal data.
Parameters:
|
array |
$criteria: |
criteria (can be ignored in which case filterData will filter the data) |
API Tags:
| Return: | data list |
| Access: | protected |
string getSelector(
string
$selector
)
|
|
Returns the full selector including added filters.
Parameters:
|
string |
$selector: |
selector |
API Tags:
| Return: | full selector string |
| Access: | protected |
boolean isValidRecord(
array
$record, array
$criteria, array
$search
)
|
|
Check if record is valid using the given selector criteria and search params.
Parameters:
|
array |
$record: |
record |
|
array |
$criteria: |
selector criteria list |
|
array |
$search: |
search fields / values |
API Tags:
| Return: | is valid? |
| Access: | protected |
array limitData(
array
$data, [int
$limit = -1], [int
$offset = 0]
)
|
|
Limit data using the given limit and offset.
Parameters:
|
array |
$data: |
data list |
|
int |
$limit: |
limit |
|
int |
$offset: |
offset |
API Tags:
| Return: | limitted data |
| Access: | protected |
array selectDb(
[string
$selector = null], [string
$order = null], [array
$limit = null]
)
|
|
Select records using the given criteria.
Parameters:
|
string |
$selector: |
selector string |
|
string |
$order: |
order string |
|
array |
$limit: |
limit array |
API Tags:
| Return: | selected records |
| Access: | public |
Don't fetch meta data.
API Tags:
Redefinition of:
- atkNode::setAttribSizes()
- This function reads meta information from the database and initialises its attributes with the metadata.
void setData(
array
$data
)
|
|
Sets the data that this node should use.
Parameters:
API Tags:
array sortData(
array
$data, string
$order
)
|
|
Sort data by the given order string.
Parameters:
|
array |
$data: |
data list |
|
string |
$order: |
order string |
API Tags:
| Return: | data list |
| Access: | protected |
array|boolean translateOrder(
string
$order
)
|
|
Parse the order to something we can use. If the order is invalid false is returned.
Parameters:
|
string |
$order: |
order string |
API Tags:
| Return: | array 1st element column, 2nd element ascending? or false |
| Access: | protected |
Update is not supported.
API Tags:
| Return: | false |
| Access: | public |
Redefinition of:
- atkNode::updateDb()
- Update a record in the database.