Framework
3.9
|
Public Member Functions | |
CompositeDataItem () | |
add () | |
cast ($class) | |
Cast this object to another class. More... | |
joinTransaction ($tx) | |
Join the DataItem to the specified DataTransaction. More... | |
getTransaction () | |
Retrieves the current DataTransaction. More... | |
populate ($line) | |
Populates the object using the supplied associative array (field -> value). More... | |
getFieldList ($alias="") | |
Returned a comma-separated list of the fields for this object (applying the assigned filter if there is one). More... | |
getFieldArray () | |
Return an array of field names for this object filtered by any active filter. More... | |
getFields () | |
Retrieve the field type list for this object. More... | |
hasField ($field) | |
Returns true if this DataItem contains a field with the specified name and that field is not excluded by a filter. More... | |
getHiddenFields () | |
Retrieves the list of hidden fields. More... | |
hasRelation ($relation) | |
Returns true if this DataItem contains a relation with the specified name. More... | |
findSubObject ($field) | |
Finds and returns the sub-object that contains the given field. More... | |
getPrimaryKey () | |
Retrieves the primary key field name. More... | |
getPrimaryKeyList () | |
Retrieves a list of all the primary keys used for an object as an array. More... | |
get ($field) | |
Retrieve the value for the specified field. More... | |
set ($field, $value) | |
Set the value of the specified field. More... | |
getType ($field) | |
Retrieves the data type of the specified field. More... | |
getFilter () | |
Returns the filter set on this object. More... | |
setFilter ($filter) | |
Sets the filter on this object. More... | |
getFieldAliases () | |
Retrieve the list of field aliases. More... | |
getFieldAnnotations () | |
Retrieve the list of field annotations. More... | |
load ($id) | |
Load the object with the specified primary key. More... | |
loadFromBase ($id) | |
save () | |
Store the object in the database. More... | |
select () | |
Select the object from the database, based on the value of the primary key field. More... | |
exists ($constraint="") | |
Check whether the object exists in the database. More... | |
update () | |
Update the row in the database that corresponds to this object. More... | |
insert () | |
Insert a new row in the database to store this object. More... | |
delete ($constraint="") | |
Delete the row in the database that corresponds to this object. More... | |
deleteAll () | |
Delete all the rows in the database that correspond to this class. More... | |
distinctValues ($field, $sorted=false, $constraint="") | |
Retrieves the distinct values in the database for the specified field across the specified set of records. More... | |
fromGET () | |
Automatically populate the object based on parameters in the $_GET collection. More... | |
fromPOST () | |
Automatically populate the object based on parameters in the $_POST collection. More... | |
fromREQUEST () | |
Automatically populate the object based on parameters in either the $_GET or $_POST collection, depending on the method used to access the page. More... | |
compare ($to) | |
Compare this object to another object. More... | |
copy ($from) | |
Copies values from another object, field by field. More... | |
toXML ($indent=0, $path=null) | |
Generates an XML representation of the object. More... | |
fromXML ($node) | |
Populates the object from the specified XML node. More... | |
format ($template="", $separator=",") | |
prettifyFieldName ($field) | |
prettifyClassName ($plural=false) | |
relateTo ($target, $field="") | |
Link this object to the specified target by setting corresponding field to the value of the target's primary key. More... | |
query ($constraints="", $page=-1, $size=-1) | |
indexedQuery ($constraints="", $indexBy="") | |
Performs a query against the database, returning an array of CompositeDataItem objects of the specified class, indexed by a particular field. More... | |
groupedQuery ($constraints="", $indexBy="") | |
Performs a query against the database, returning an array of arrays of CompositeDataItem objects of the specified class, grouped by a particular field. More... | |
Public Member Functions inherited from AbstractDataItem | |
decorate ($name, $value) | |
Adds a decoration to the DataItem. More... | |
getDecoration ($name) | |
Retrieve the value of a decoration on the current DataItem. More... | |
setOption ($opt) | |
Set a behavior option flag. More... | |
clearOptions ($opt) | |
Clear the specified behavior option flag. More... | |
getConnection () | |
Retrieves a connection to the database. More... | |
getIdentityConstraint () | |
Subclasses can override this function to provide additional identity constraints to be used when querying or updating. More... | |
getPrimaryKeyValue () | |
Retrieves the primary key value. More... | |
cacheLookup ($id) | |
Populate the object from the local cache if the object is marked as "cacheLocal". More... | |
quoteFieldValue ($field, $type=null) | |
Returns the properly quoted value of the specified field. More... | |
quoteValue ($val, $type) | |
formatFieldValue ($field, $template="") | |
formatFieldForXML ($field) | |
Format field for XML output. More... | |
reformatToSQLDate ($date) | |
Reformats the specified date to be in a format used by the database. More... | |
reformatFromSQLDate ($date) | |
fromJSON ($json) | |
Populate from the supplied JSON object. More... | |
Public Attributes | |
$__objects | |
$__tx = null | |
Public Attributes inherited from AbstractDataItem | |
$filter | |
$_options = 0 | |
$_tx = null | |
Tracks the current database transaction for each DataItem. More... | |
$_decorations = null | |
Definition at line 40 of file composite_data_item.inc.
CompositeDataItem::add | ( | ) |
Definition at line 50 of file composite_data_item.inc.
CompositeDataItem::cast | ( | $class | ) |
Cast this object to another class.
This facility is provided so that it is possible to cast from a CompositeDataItem to one of its constituents to provide support for polymorphism in those cases.
string | $class |
DataItemException |
Reimplemented from AbstractDataItem.
Definition at line 83 of file composite_data_item.inc.
CompositeDataItem::compare | ( | $to | ) |
Compare this object to another object.
If all the fields match, the method returns true, otherwise false. If a filter is in place on the source object, then only the filtered fields are compared.
object | $to | the object with which to compare this object |
Reimplemented from AbstractDataItem.
Definition at line 601 of file composite_data_item.inc.
CompositeDataItem::CompositeDataItem | ( | ) |
Definition at line 45 of file composite_data_item.inc.
CompositeDataItem::copy | ( | $from | ) |
Copies values from another object, field by field.
If a filter is in place on the source object, then only the filtered fields are copied.
object | from the object from which data is to be copied |
Reimplemented from AbstractDataItem.
Definition at line 620 of file composite_data_item.inc.
CompositeDataItem::delete | ( | $constraint = "" | ) |
Delete the row in the database that corresponds to this object.
Reimplemented from AbstractDataItem.
Definition at line 510 of file composite_data_item.inc.
CompositeDataItem::deleteAll | ( | ) |
Delete all the rows in the database that correspond to this class.
Reimplemented from AbstractDataItem.
Definition at line 528 of file composite_data_item.inc.
CompositeDataItem::distinctValues | ( | $field, | |
$sorted = false , |
|||
$constraint = "" |
|||
) |
Retrieves the distinct values in the database for the specified field across the specified set of records.
string | $field | |
boolean | $sorted | |
string | $constraint |
Reimplemented from AbstractDataItem.
Definition at line 544 of file composite_data_item.inc.
CompositeDataItem::exists | ( | $constraint = "" | ) |
Check whether the object exists in the database.
Reimplemented from AbstractDataItem.
Definition at line 471 of file composite_data_item.inc.
CompositeDataItem::findSubObject | ( | $field | ) |
Finds and returns the sub-object that contains the given field.
string | $field | the field for which to search |
Definition at line 241 of file composite_data_item.inc.
CompositeDataItem::format | ( | $template = "" , |
|
$separator = "," |
|||
) |
CompositeDataItem::fromGET | ( | ) |
Automatically populate the object based on parameters in the $_GET collection.
Reimplemented from AbstractDataItem.
Definition at line 560 of file composite_data_item.inc.
CompositeDataItem::fromPOST | ( | ) |
Automatically populate the object based on parameters in the $_POST collection.
If the key does not exist in $_POST and the type is Boolean, that means that the user unchecked a checkbox and we need to assign 0 to the field.
Reimplemented from AbstractDataItem.
Definition at line 574 of file composite_data_item.inc.
CompositeDataItem::fromREQUEST | ( | ) |
Automatically populate the object based on parameters in either the $_GET or $_POST collection, depending on the method used to access the page.
Reimplemented from AbstractDataItem.
Definition at line 586 of file composite_data_item.inc.
CompositeDataItem::fromXML | ( | $node | ) |
Populates the object from the specified XML node.
DOMNode | $node |
Reimplemented from AbstractDataItem.
Definition at line 654 of file composite_data_item.inc.
CompositeDataItem::get | ( | $field | ) |
Retrieve the value for the specified field.
string | $field | the field to retrieve |
Reimplemented from AbstractDataItem.
Definition at line 282 of file composite_data_item.inc.
CompositeDataItem::getFieldAliases | ( | ) |
Retrieve the list of field aliases.
Reimplemented from AbstractDataItem.
Definition at line 344 of file composite_data_item.inc.
CompositeDataItem::getFieldAnnotations | ( | ) |
Retrieve the list of field annotations.
Reimplemented from AbstractDataItem.
Definition at line 366 of file composite_data_item.inc.
CompositeDataItem::getFieldArray | ( | ) |
Return an array of field names for this object filtered by any active filter.
Reimplemented from AbstractDataItem.
Definition at line 158 of file composite_data_item.inc.
CompositeDataItem::getFieldList | ( | $alias = "" | ) |
Returned a comma-separated list of the fields for this object (applying the assigned filter if there is one).
Reimplemented from AbstractDataItem.
Definition at line 139 of file composite_data_item.inc.
CompositeDataItem::getFields | ( | ) |
Retrieve the field type list for this object.
Reimplemented from AbstractDataItem.
Definition at line 176 of file composite_data_item.inc.
CompositeDataItem::getFilter | ( | ) |
Returns the filter set on this object.
Reimplemented from AbstractDataItem.
Definition at line 323 of file composite_data_item.inc.
CompositeDataItem::getHiddenFields | ( | ) |
Retrieves the list of hidden fields.
These will be automatically hidden in any AutoForm.
Reimplemented from AbstractDataItem.
Definition at line 207 of file composite_data_item.inc.
CompositeDataItem::getPrimaryKey | ( | ) |
Retrieves the primary key field name.
Reimplemented from AbstractDataItem.
Definition at line 254 of file composite_data_item.inc.
CompositeDataItem::getPrimaryKeyList | ( | ) |
Retrieves a list of all the primary keys used for an object as an array.
Reimplemented from AbstractDataItem.
Definition at line 265 of file composite_data_item.inc.
CompositeDataItem::getTransaction | ( | ) |
Retrieves the current DataTransaction.
Reimplemented from AbstractDataItem.
Definition at line 107 of file composite_data_item.inc.
CompositeDataItem::getType | ( | $field | ) |
Retrieves the data type of the specified field.
$field | the field in question |
Reimplemented from AbstractDataItem.
Definition at line 310 of file composite_data_item.inc.
CompositeDataItem::groupedQuery | ( | $constraints = "" , |
|
$indexBy = "" |
|||
) |
Performs a query against the database, returning an array of arrays of CompositeDataItem objects of the specified class, grouped by a particular field.
If the indexing field has unique values, indexedQuery() might be more appropriate.
string | $constraints | optional constraint clause to apply to the query in the form "WHERE ... [ORDER BY ...]" |
string | $field | optional the name of the field by which to group the results |
Definition at line 837 of file composite_data_item.inc.
CompositeDataItem::hasField | ( | $field | ) |
Returns true if this DataItem contains a field with the specified name and that field is not excluded by a filter.
string | $field |
Reimplemented from AbstractDataItem.
Definition at line 197 of file composite_data_item.inc.
CompositeDataItem::hasRelation | ( | $relation | ) |
Returns true if this DataItem contains a relation with the specified name.
string | $relation |
Reimplemented from AbstractDataItem.
Definition at line 226 of file composite_data_item.inc.
CompositeDataItem::indexedQuery | ( | $constraints = "" , |
|
$indexBy = "" |
|||
) |
Performs a query against the database, returning an array of CompositeDataItem objects of the specified class, indexed by a particular field.
If more than one item is found that matches the same value of the indexing field, the results entry is promoted to an array automatically. However, in cases where this is common, using groupedQuery() might simplify your calling code.
string | $constraints | optional constraint clause to apply to the query in the form "WHERE ... [ORDER BY ...]" |
string | $field | optional the name of the field by which to index the results (See InclusionFilter and ExclusionFilter) |
Definition at line 768 of file composite_data_item.inc.
CompositeDataItem::insert | ( | ) |
Insert a new row in the database to store this object.
Reimplemented from AbstractDataItem.
Definition at line 490 of file composite_data_item.inc.
CompositeDataItem::joinTransaction | ( | $tx | ) |
Join the DataItem to the specified DataTransaction.
DataTransaction | $tx | the transaction to join |
Reimplemented from AbstractDataItem.
Definition at line 94 of file composite_data_item.inc.
CompositeDataItem::load | ( | $id | ) |
Load the object with the specified primary key.
int | id the primary key value to instantiate from |
Reimplemented from AbstractDataItem.
Definition at line 389 of file composite_data_item.inc.
CompositeDataItem::loadFromBase | ( | $id | ) |
Definition at line 406 of file composite_data_item.inc.
CompositeDataItem::populate | ( | $line | ) |
Populates the object using the supplied associative array (field -> value).
Only values that match the definition of the sub-classed object will be copied. Fields that have been excluded by the use of an InclusionFilter or ExclusionFilter will also not be populated.
array | $line | the array of values to populate the object with. |
Reimplemented from AbstractDataItem.
Definition at line 120 of file composite_data_item.inc.
CompositeDataItem::prettifyClassName | ( | $plural = false | ) |
Reimplemented from AbstractDataItem.
Definition at line 690 of file composite_data_item.inc.
CompositeDataItem::prettifyFieldName | ( | $field | ) |
Reimplemented from AbstractDataItem.
Definition at line 679 of file composite_data_item.inc.
CompositeDataItem::query | ( | $constraints = "" , |
|
$page = -1 , |
|||
$size = -1 |
|||
) |
Definition at line 731 of file composite_data_item.inc.
CompositeDataItem::relateTo | ( | $target, | |
$field = "" |
|||
) |
Link this object to the specified target by setting corresponding field to the value of the target's primary key.
DataItem | $target | the DataItem to which the relationship will be created |
string | $field | the field to set for the relationship. If not specified, the primary key of the target object is used for the foreign key field name. |
Reimplemented from AbstractDataItem.
Definition at line 716 of file composite_data_item.inc.
CompositeDataItem::save | ( | ) |
Store the object in the database.
Reimplemented from AbstractDataItem.
Definition at line 426 of file composite_data_item.inc.
CompositeDataItem::select | ( | ) |
Select the object from the database, based on the value of the primary key field.
Reimplemented from AbstractDataItem.
Definition at line 451 of file composite_data_item.inc.
CompositeDataItem::set | ( | $field, | |
$value | |||
) |
Set the value of the specified field.
$field | the field to set |
$value | the value to which the field is to be set |
Reimplemented from AbstractDataItem.
Definition at line 297 of file composite_data_item.inc.
CompositeDataItem::setFilter | ( | $filter | ) |
Sets the filter on this object.
$filter | the filter |
Reimplemented from AbstractDataItem.
Definition at line 332 of file composite_data_item.inc.
CompositeDataItem::toXML | ( | $indent = 0 , |
|
$path = null |
|||
) |
Generates an XML representation of the object.
Filters are honored when determining which fields are included in the XML. Empty fields are not output (note that a string field with value "" is not considered empty).
Reimplemented from AbstractDataItem.
Definition at line 637 of file composite_data_item.inc.
CompositeDataItem::update | ( | ) |
Update the row in the database that corresponds to this object.
Reimplemented from AbstractDataItem.
Definition at line 479 of file composite_data_item.inc.
CompositeDataItem::$__objects |
Definition at line 42 of file composite_data_item.inc.
CompositeDataItem::$__tx = null |
Definition at line 43 of file composite_data_item.inc.