Class InUse Class for In-Use management
author | Timo A. Hummel <Timo.Hummel@4fb.de> |
---|---|
version | 0.1 |
copyright | four for business 2003 |
InUseCollection()
ItemCollection(string $table, $primaryKey, $lifetime)
inherited_from | \ItemCollection::ItemCollection() |
---|
string
The table to use as information source
_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() |
---|
checkAndMark($type, $objectid, $returnWarning, $warningTemplate, $allowOverride, $location) : mixed
Example: Check for "idmod", also return a lock message: list($inUse, $message) = $col->checkAndMark("idmod", $idmod, true, i18n("Module is in use by %s (%s)"));
Example 2: Check for "idmod", don't return a lock message $inUse = $col->checkAndMark("idmod", $idmod);
string Specifies the type to de-mark.
mixed Specifies the object ID
boolean If true, also returns an error message if in use
string String to fill with the template (%s as placeholder, first %s is the username, second is the real name)
boolean True if the user can override the lock
string Value to append to the override lock button
mixed
If returnWarning is false, returns a boolean value wether the object is locked. If
returnWarning is true, returns a 2 item array (boolean inUse, string errormessage).checkMark($type, $objectid) : int
string Specifies the type to de-mark.
mixed Specifies the object ID
int
Returns false if it's not in use or returns the object if it is.count() : integer
inherited_from | \ItemCollection::count() |
---|
integer
Number of rowscreate()
inherited_from | \ItemCollection::create() |
---|
delete($id)
inherited_from | \ItemCollection::delete() |
---|
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-Objectslink($foreignClass)
inherited_from | \ItemCollection::link() |
---|
loadItem($vitem) : object
Needs to be overridden by the extension class.
inherited_from | \ItemCollection::loadItem() |
---|
object
The newly created objectmarkInUse($type, $objectid, $session, $user)
Note that items are released when the session is destroyed.
Currently, the following types are defined and approved as internal Contenido standard: article module layout template
string Specifies the type to mark.
mixed Specifies the object ID
string Specifies the session for which the "in use" mark is valid
string Specifies the user which requested the in-use flag
next() : 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
resultremoveItemMarks($type, $itemid)
string Specifies the type to de-mark.
string Specifies the item
removeMark($type, $objectid, $session)
string Specifies the type to de-mark.
mixed Specifies the object ID
string Specifies the session for which the "in use" mark is valid
removeResultField($field)
inherited_from | \ItemCollection::removeResultField() |
---|
removeSessionMarks($session)
string Specifies the session for which the "in use" marks should be removed
removeTypeMarks($type, $session)
string Specifies the type to de-mark.
string Specifies the session for which the "in use" mark is valid
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() |
---|
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 |
$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 |