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() |
---|
string
The table to use as information source
PropertyCollection()
_buildGroupWhereStatements() : array
Builds a where statement out of the setGroupWhere calls
inherited_from | \ItemCollection::_buildGroupWhereStatements() |
---|
array
with all where statements_buildWhereStatements() : array
Builds a where statement out of the setWhere calls
inherited_from | \ItemCollection::_buildWhereStatements() |
---|
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
inherited_from | \ItemCollection::_fetchJoinTables() |
---|
\none
array
see 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() |
---|
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
inherited_from | \ItemCollection::_setJoinPartner() |
---|
string
Specifies the foreign class to use
\none
addResultField($field)
inherited_from | \ItemCollection::addResultField() |
---|
changeClient($idclient)
count() : integer
inherited_from | \ItemCollection::count() |
---|
integer
Number of rowscreate($itemtype, $itemid, $type, $name, $value, $bInternally)
delete($id)
deleteProperties(\itemtype $itemtype, \itemid $itemid)
\itemtype
mixed Type of the item (example: idcat)
\itemid
mixed ID of the item (example: 31)
deleteValue(\itemtype $itemtype, \itemid $itemid, \type $type, \name $name)
Example:
$properties->deleteValue("idcat", 27, "visual", "image");
\itemtype
mixed Type of the item (example: idcat)
\itemid
mixed ID of the item (example: 31)
\type
mixed Type of the data to store (arbitary data)
\name
mixed 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() |
---|
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.
inherited_from | \ItemCollection::fetchArray() |
---|
string Name of the field to use for the key
mixed String or array
array
Resulting 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() |
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-ObjectsgetAllValues($field, $fieldValue, $auth) : array
Field to search in
Value to search for
Narrow result down to user in auth objext
array
for each given itemgetProperties(\itemtype $itemtype, \itemid $itemid) : array
\itemtype
mixed Type of the item (example: idcat)
\itemid
mixed ID of the item (example: 31)
array
for each given itemgetValue(\itemtype $itemtype, \itemid $itemid, \type $type, \name $name, $default) : mixed
Example:
$file = $properties->getValue("idcat", 27, "visual", "image");
\itemtype
mixed Type of the item (example: idcat)
\itemid
mixed ID of the item (example: 31)
\type
mixed Type of the data to store (arbitary data)
\name
mixed Entry name
mixed
ValuegetValuesByType(\itemtype $itemtype, \itemid $itemid, \type $type) : array
Example:
$file = $properties->getValuesByType("idcat", 27, "visual");
\itemtype
mixed Type of the item (example: idcat)
\itemid
mixed ID of the item (example: 31)
\type
mixed Type of the data to store (arbitary data)
array
Valuelink($foreignClass)
inherited_from | \ItemCollection::link() |
---|
loadItem($vitem) : object
Needs to be overridden by the extension class.
inherited_from | \ItemCollection::loadItem() |
---|
object
The newly created objectnext() : object
inherited_from | \ItemCollection::next() |
---|
object
The next object, or false if no more objectsquery()
inherited_from | \ItemCollection::query() |
---|
queryAndFetchStructured(\objects $objects) : array
inherited_from | \ItemCollection::queryAndFetchStructured() |
---|
\objects
array with the correct order of the objects
array
resultremoveResultField($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() |
---|
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)
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");
\itemtype
mixed Type of the item (example: idcat)
\itemid
mixed ID of the item (example: 31)
\type
mixed Type of the data to store (arbitary data)
\name
mixed Entry name
\value
mixed Value
\idProp
int 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 |