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)
| inherited_from | \ItemCollection::ItemCollection() |
|---|
stringThe table to use as information source
PropertyCollection()
_buildGroupWhereStatements() : array
Builds a where statement out of the setGroupWhere calls
| inherited_from | \ItemCollection::_buildGroupWhereStatements() |
|---|
arraywith all where statements_buildWhereStatements() : array
Builds a where statement out of the setWhere calls
| inherited_from | \ItemCollection::_buildWhereStatements() |
|---|
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
| inherited_from | \ItemCollection::_fetchJoinTables() |
|---|
\none
arraysee above_findReverseJoinPartner($parentclass, $classname)
| inherited_from | \ItemCollection::_findReverseJoinPartner() |
|---|
_initializeDriver($bForceInit)
| inherited_from | \ItemCollection::_initializeDriver() |
|---|
boolean If true, forces the driver to initialize, even if it already exists.
_recursiveStructuredFetch($objects, $array)
| inherited_from | \ItemCollection::_recursiveStructuredFetch() |
|---|
_resolveLinks()
| inherited_from | \ItemCollection::_resolveLinks() |
|---|
_setItemClass(string $classname) : \none
| inherited_from | \ItemCollection::_setItemClass() |
|---|
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
| inherited_from | \ItemCollection::_setJoinPartner() |
|---|
stringSpecifies the foreign class to use
\noneaddResultField($field)
| inherited_from | \ItemCollection::addResultField() |
|---|
changeClient($idclient)
count() : integer
| inherited_from | \ItemCollection::count() |
|---|
integerNumber of rowscreate($itemtype, $itemid, $type, $name, $value, $bInternally)
delete($id)
deleteProperties(\itemtype $itemtype, \itemid $itemid)
\itemtypemixed Type of the item (example: idcat)
\itemidmixed ID of the item (example: 31)
deleteValue(\itemtype $itemtype, \itemid $itemid, \type $type, \name $name)
Example:
$properties->deleteValue("idcat", 27, "visual", "image");
\itemtypemixed Type of the item (example: idcat)
\itemidmixed ID of the item (example: 31)
\typemixed Type of the data to store (arbitary data)
\namemixed Entry name
deleteWhere($field, $restriction, $operator)
Restricts a query with a where clause
| inherited_from | \ItemCollection::deleteWhere() |
|---|
deleteWhereGroup($group, $field, $restriction, $operator)
Restricts a query with a where clause, groupable
| inherited_from | \ItemCollection::deleteWhereGroup() |
|---|
exists(integer $id) : boolean
| inherited_from | \ItemCollection::exists() |
|---|
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.
| inherited_from | \ItemCollection::fetchArray() |
|---|
string Name of the field to use for the key
mixed String or array
arrayResulting arrayfetchObject($class)
| inherited_from | \ItemCollection::fetchObject() |
|---|
fetchTable($fields, $objects)
| inherited_from | \ItemCollection::fetchTable() |
|---|
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 |
|---|---|
| inherited_from | \ItemCollection::flexSelect() |
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-ObjectsgetAllValues($field, $fieldValue, $auth) : array
Field to search in
Value to search for
Narrow result down to user in auth objext
arrayfor each given itemgetProperties(\itemtype $itemtype, \itemid $itemid) : array
\itemtypemixed Type of the item (example: idcat)
\itemidmixed ID of the item (example: 31)
arrayfor each given itemgetValue(\itemtype $itemtype, \itemid $itemid, \type $type, \name $name, $default) : mixed
Example:
$file = $properties->getValue("idcat", 27, "visual", "image");
\itemtypemixed Type of the item (example: idcat)
\itemidmixed ID of the item (example: 31)
\typemixed Type of the data to store (arbitary data)
\namemixed Entry name
mixedValuegetValuesByType(\itemtype $itemtype, \itemid $itemid, \type $type) : array
Example:
$file = $properties->getValuesByType("idcat", 27, "visual");
\itemtypemixed Type of the item (example: idcat)
\itemidmixed ID of the item (example: 31)
\typemixed Type of the data to store (arbitary data)
arrayValuelink($foreignClass)
| inherited_from | \ItemCollection::link() |
|---|
loadItem($vitem) : object
Needs to be overridden by the extension class.
| inherited_from | \ItemCollection::loadItem() |
|---|
objectThe newly created objectnext() : object
| inherited_from | \ItemCollection::next() |
|---|
objectThe next object, or false if no more objectsquery()
| inherited_from | \ItemCollection::query() |
|---|
queryAndFetchStructured(\objects $objects) : array
| inherited_from | \ItemCollection::queryAndFetchStructured() |
|---|
\objectsarray with the correct order of the objects
arrayresultremoveResultField($field)
| inherited_from | \ItemCollection::removeResultField() |
|---|
resetQuery()
| inherited_from | \ItemCollection::resetQuery() |
|---|
select(string $where, string $group_by, string $order_by, string $limit) : array
Objects are loaded using their primary key.
| inherited_from | \ItemCollection::select() |
|---|
stringSpecifies the where clause.
stringSpecifies the group by clause.
stringSpecifies the order by clause.
stringSpecifies the limit by clause.
arrayArray of DBObject-ObjectssetEncoding($sEncoding)
| inherited_from | \ItemCollection::setEncoding() |
|---|
setGroupCondition($group1, $group2, $condition)
Defines how groups are linked to each other
| inherited_from | \ItemCollection::setGroupCondition() |
|---|
setInnerGroupCondition($group, $condition)
Defines how relations in one group are linked each together
| inherited_from | \ItemCollection::setInnerGroupCondition() |
|---|
setLimit($iRowStart, $iRowCount)
| inherited_from | \ItemCollection::setLimit() |
|---|
setOrder($order)
| inherited_from | \ItemCollection::setOrder() |
|---|
setValue(\itemtype $itemtype, \itemid $itemid, \type $type, \name $name, \value $value, \idProp $idProp)
Handles creation and updating.
Example:
$properties->setValue("idcat", 27, "visual", "image", "images/tool.gif");
\itemtypemixed Type of the item (example: idcat)
\itemidmixed ID of the item (example: 31)
\typemixed Type of the data to store (arbitary data)
\namemixed Entry name
\valuemixed Value
\idPropint id of database record (if set, update on this basis (possiblity to update name value and type))
setWhere($field, $restriction, $operator)
Restricts a query with a where clause
| inherited_from | \ItemCollection::setWhere() |
|---|
setWhereGroup($group, $field, $restriction, $operator)
Restricts a query with a where clause, groupable
| inherited_from | \ItemCollection::setWhereGroup() |
|---|
$_JoinPartners : array
| access | private |
|---|---|
| inherited_from | \ItemCollection::$$_JoinPartners |
$_encoding : string
| access | private |
|---|---|
| inherited_from | \ItemCollection::$$_encoding |
$_forwardJoinPartners : array
| access | private |
|---|---|
| inherited_from | \ItemCollection::$$_forwardJoinPartners |
$_groupConditions : array
| access | private |
|---|---|
| inherited_from | \ItemCollection::$$_groupConditions |
$_innerGroupConditions : array
| access | private |
|---|---|
| inherited_from | \ItemCollection::$$_innerGroupConditions |
$_itemClass : string
| access | private |
|---|---|
| inherited_from | \ItemCollection::$$_itemClass |
$_iteratorItem : object
| access | private |
|---|---|
| inherited_from | \ItemCollection::$$_iteratorItem |
$_resultFields : array
| access | private |
|---|---|
| inherited_from | \ItemCollection::$$_resultFields |
$_whereRestriction : array
| access | private |
|---|---|
| inherited_from | \ItemCollection::$$_whereRestriction |
$cache : array
| access | private |
|---|---|
| inherited_from | \ItemCollection::$$cache |
$client
$db : object
| access | private |
|---|---|
| inherited_from | \ItemCollection::$$db |
$lasterror : string
| access | private |
|---|---|
| inherited_from | \ItemCollection::$$lasterror |
$lifetime : int
| access | private |
|---|---|
| inherited_from | \ItemCollection::$$lifetime |
$objects : string
| access | private |
|---|---|
| inherited_from | \ItemCollection::$$objects |
$primaryKey : string
| access | private |
|---|---|
| inherited_from | \ItemCollection::$$primaryKey |
$properties : array
| access | private |
|---|---|
| inherited_from | \ItemCollection::$$properties |
$table : string
| access | private |
|---|---|
| inherited_from | \ItemCollection::$$table |
$virgin : array
| access | private |
|---|---|
| inherited_from | \ItemCollection::$$virgin |