Class ItemCollection Class for database based item collections
| author | Timo A. Hummel <Timo.Hummel@4fb.de> |
|---|---|
| version | 0.1 |
| copyright | four for business 2003 |
ItemCollection(string $table, $primaryKey, $lifetime)
stringThe table to use as information source
_buildGroupWhereStatements() : array
Builds a where statement out of the setGroupWhere calls
arraywith all where statements_buildWhereStatements() : array
Builds a where statement out of the setWhere calls
arraywith all where statements_fetchJoinTables(\none $ignore_root) : array
Fetches all tables which will be joined later on.
The returned array has the following format:
array( array(fields), array(tables), array(joins), array(wheres) );
Notes: The table is the table name which needs to be added to the FROM clause The join statement which is inserted after the master table The where statement is combined with all other where statements The fields to select from
\none
arraysee above_findReverseJoinPartner($parentclass, $classname)
_initializeDriver($bForceInit)
boolean If true, forces the driver to initialize, even if it already exists.
_recursiveStructuredFetch($objects, $array)
_resolveLinks()
_setItemClass(string $classname) : \none
stringspecifies the classname
\none_setJoinPartner(string $foreignCollectionClass) : \none
Important: The class specified by $foreignCollectionClass needs to be a collection class and has to exist Define all links in the constructor of your object
stringSpecifies the foreign class to use
\noneaddResultField($field)
count() : integer
integerNumber of rowscreate()
delete($id)
deleteWhere($field, $restriction, $operator)
Restricts a query with a where clause
deleteWhereGroup($group, $field, $restriction, $operator)
Restricts a query with a where clause, groupable
exists(integer $id) : boolean
integerThe id to check for
booleantrue if object exists, false if notfetchArray($key, $fields) : array
Example: $i = $object->fetchArray("idartlang", array("idlang", "name"));
could result in: $i[5] = array("idlang" => 5, "name" => "My Article");
Important: If you don't pass an array for fields, the function doesn't create an array.
string Name of the field to use for the key
mixed String or array
arrayResulting arrayfetchObject($class)
fetchTable($fields, $objects)
flexSelect(string $distinct, string $from, string $where, string $group_by, string $order_by, string $limit) : array
Objects are loaded using their primary key.
| author | HerrB |
|---|
stringSpecifies if distinct will be added to the SQL statement ($distinct !== "" -> DISTINCT)
stringSpecifies the additional from clause (e.g. "con_news_groups AS groups, con_news_groupmembers AS groupmembers").
stringSpecifies the where clause.
stringSpecifies the group by clause.
stringSpecifies the order by clause.
stringSpecifies the limit by clause.
arrayArray of DBObject-Objectslink($foreignClass)
loadItem($vitem) : object
Needs to be overridden by the extension class.
objectThe newly created objectnext() : object
objectThe next object, or false if no more objectsquery()
queryAndFetchStructured(\objects $objects) : array
\objectsarray with the correct order of the objects
arrayresultremoveResultField($field)
resetQuery()
select(string $where, string $group_by, string $order_by, string $limit) : array
Objects are loaded using their primary key.
stringSpecifies the where clause.
stringSpecifies the group by clause.
stringSpecifies the order by clause.
stringSpecifies the limit by clause.
arrayArray of DBObject-ObjectssetEncoding($sEncoding)
setGroupCondition($group1, $group2, $condition)
Defines how groups are linked to each other
setInnerGroupCondition($group, $condition)
Defines how relations in one group are linked each together
setLimit($iRowStart, $iRowCount)
setOrder($order)
setWhere($field, $restriction, $operator)
Restricts a query with a where clause
setWhereGroup($group, $field, $restriction, $operator)
Restricts a query with a where clause, groupable
$_JoinPartners : array
| access | private |
|---|
$_encoding : string
| access | private |
|---|
$_forwardJoinPartners : array
| access | private |
|---|
$_groupConditions : array
| access | private |
|---|
$_innerGroupConditions : array
| access | private |
|---|
$_itemClass : string
| access | private |
|---|
$_iteratorItem : object
| access | private |
|---|
$_resultFields : array
| access | private |
|---|
$_whereRestriction : array
| access | private |
|---|
$cache : array
| access | private |
|---|
$db : object
| access | private |
|---|
$lasterror : string
| access | private |
|---|
$lifetime : int
| access | private |
|---|
$objects : string
| access | private |
|---|
$primaryKey : string
| access | private |
|---|
$properties : array
| access | private |
|---|
$table : string
| access | private |
|---|
$virgin : array
| access | private |
|---|