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)
string
The table to use as information source
_buildGroupWhereStatements() : array
Builds a where statement out of the setGroupWhere calls
array
with all where statements_buildWhereStatements() : array
Builds a where statement out of the setWhere calls
array
with 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
array
see 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
string
specifies 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
string
Specifies the foreign class to use
\none
addResultField($field)
count() : integer
integer
Number 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
integer
The id to check for
boolean
true 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
array
Resulting 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 |
---|
string
Specifies if distinct will be added to the SQL statement ($distinct !== "" -> DISTINCT)
string
Specifies the additional from clause (e.g. "con_news_groups AS groups, con_news_groupmembers AS groupmembers").
string
Specifies the where clause.
string
Specifies the group by clause.
string
Specifies the order by clause.
string
Specifies the limit by clause.
array
Array of DBObject-Objectslink($foreignClass)
loadItem($vitem) : object
Needs to be overridden by the extension class.
object
The newly created objectnext() : object
object
The next object, or false if no more objectsquery()
queryAndFetchStructured(\objects $objects) : array
\objects
array with the correct order of the objects
array
resultremoveResultField($field)
resetQuery()
select(string $where, string $group_by, string $order_by, string $limit) : array
Objects are loaded using their primary key.
string
Specifies the where clause.
string
Specifies the group by clause.
string
Specifies the order by clause.
string
Specifies the limit by clause.
array
Array 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 |
---|