Framework  3.9
data_item.inc File Reference

Go to the source code of this file.

Classes

class  DataItem
 DataItem is the generic base class for database mapped classes. More...
 
class  DataItemFieldComparator
 Simple field comparator to support sorting arrays of DataItems by the values in a specified field. More...
 

Functions

 querySingle ($class)
 Performs a query against the database and returns a matching singleton object. More...
 
 queryValue ($class, $func)
 Query the database to calculate an aggregate value. More...
 
 reindexList ($list, $field, $autoPromote=true)
 Reindex an indexed or grouped query result by a different field. More...
 
 regroupList ($list, $field)
 Regroup an indexed or grouped query result by a different field. More...
 
 removeDuplicates ($list, $field="")
 Remove duplicate DataItems from a list, based on the value of a field. More...
 
 sortList (&$list, $field)
 Sorts an array of DataItems based on the values in the specified field. More...
 
 updateSortOrder ($class, $field="sort_order", $params=null)
 Utility method to update sort order for the selected class of objects based on an array that maps primary keys to sort order values. More...
 
 toXML ($tag, $objects, $header=null)
 
 toJSON ($items)
 
 toJSONGrouped ($items)
 
 toJSONIndexed ($items)
 
 fromJSON ($class, $json)
 
 displayFieldAsList ($items, $field, $separator=", ")
 
 formatItems ($items, $template, $separator="")
 Format a list of DataItems using the specified templated. More...
 
 extractItems ($items, $indexFormat, $valueFormat)
 
 extractFieldValues ($items, $field)
 Extract the field values for the specified field from a list of DataItems. More...
 
 extractIndexedFieldValues ($items, $field)
 Extract the field values for the specified field from a list of DataItems and return them in an array indexed by the primary key values of the source DataItems. More...
 
 itemExists ($class, $key)
 Utility method to test for the existence of a DataItem record in the database. More...
 
 findItem ($items, $field, $value)
 Find the first item in the array that matches the supplied value for the specified field. More...
 
 findItemIndex ($items, $field, $value)
 Find the index of the first item in the array that matches the supplied value for the specified field. More...
 
 restoreHTML ($text)
 
 dumpCSV ($class, $items, $filepath, $filter=null, $append=false)
 Dump a raw representation of a list of DataItems to CSV (one column per field, default format only) More...