__construct()
addResultField()
count()
create()
delete()
deleteBy()
deleteByWhereClause()
deleteWhere()
deleteWhereGroup()
escape()
exists()
fetchArray()
fetchById()
fetchObject()
fetchTable()
flexSelect()
link()
loadItem()
next()
query()
queryAndFetchStructured()
removeResultField()
resetQuery()
select()
setEncoding()
setGroupCondition()
setInnerGroupCondition()
setLimit()
setOrder()
setWhere()
setWhereGroup()
_buildGroupWhereStatements()
_buildWhereStatements()
_delete()
_fetchJoinTables()
_findReverseJoinPartner()
_getPropertiesCollectionInstance()
_getSecondDBInstance()
_initializeDriver()
_recursiveStructuredFetch()
_resolveLinks()
_setItemClass()
_setJoinPartner()
$primaryKey
$virgin
$_JoinPartners
$_aOperators
$_bAllMode
$_className
$_collectionCache
$_driver
$_encoding
$_forwardJoinPartners
$_groupConditions
$_innerGroupConditions
$_itemClass
$_iteratorItem
$_oCache
$_resultFields
$_settings
$_whereRestriction
$cache
$db
$lasterror
$lifetime
$objects
$properties
$secondDb
$table
Class ItemCollection Abstract class for database based item collections.
Base class with common features for database based items and item collections.
| author | Timo A. Hummel <Timo.Hummel@4fb.de> |
|---|---|
| author | Murat Purc |
| version | 0.2 |
| copyright | four for business 2003 |
__construct(string $sTable, string $sPrimaryKey, int $iLifetime)
stringThe table to use as information source
stringThe primary key to use
int
\Contenido_ItemException |
If table name or primary key is not set |
|---|
addResultField(string $sField)
string
count() : int
intNumber of rowscreate() : \Item
\ItemThe newly created objectdelete(mixed $mId) : bool
Deletes also cached e entry and any existing properties.
mixedId of entry to delete
booldeleteBy(string $sField, mixed $mValue) : int
Deletes also cached e entries and any existing properties.
stringThe field name
mixedThe value of the field
intNumber of deleted entriesdeleteByWhereClause(string $sWhere) : int
Deletes also cached e entries and any existing properties.
stringThe where clause of the SQL statement
intNumber of deleted entriesdeleteWhere(string $sField, mixed $mRestriction, string $sOperator)
string
mixed
string
deleteWhereGroup(string $sGroup, string $sField, mixed $mRestriction, string $sOperator)
string
string
mixed
string
escape(string $sString) : string
| inherited_from | \Contenido_ItemBaseAbstract::escape() |
|---|
stringThe string to escape
stringEscaped stringexists(mixed $mId) : bool
mixedThe id to check for (could be numeric or string)
boolTrue if object exists, false if notfetchArray(string $sKey, mixed $mFields) : 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.
stringName of the field to use for the key
mixedString or array
arrayResulting arrayfetchObject($sClassName)
Item
fetchTable(array $aFields, array $aObjects)
flexSelect(string $sDistinct, string $sFrom, string $sWhere, string $sGroupBy, string $sOrderBy, string $sLimit) : bool
| author | HerrB |
|---|
stringSpecifies if distinct will be added to the SQL statement ($sDistinct !== '' -> 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.
boolTrue on success, otherwhise falselink(string $sForeignClass)
stringThe class of foreign table to use
loadItem(mixed $mItem) : \Item
mixedThe primary key of the item to load or a recordset with itemdata (array) to inject to the item object.
\Contenido_ItemException |
If item class is not set |
|---|
\ItemThe newly created objectnext() : \Item | bool
\ItemboolThe next object, or false if no more objectsquery() : bool
boolqueryAndFetchStructured(array $aObjects) : array
arrayWith the correct order of the objects
arrayResultremoveResultField(string $sField)
string
resetQuery()
select(string $sWhere, string $sGroupBy, string $sOrderBy, string $sLimit) : bool
stringSpecifies the where clause.
stringSpecifies the group by clause.
stringSpecifies the order by clause.
stringSpecifies the limit by clause.
boolTrue on success, otherwhise falsesetEncoding(string $sEncoding)
string
setGroupCondition(string $sGroup1, string $sGroup2, string $sCondition)
string
string
string
setInnerGroupCondition(string $sGroup, string $sCondition)
string
string
setLimit(int $iRowStart, int $iRowCount)
int
int
setOrder(string $order)
string
setWhere(string $sField, mixed $mRestriction, string $sOperator)
string
mixed
string
setWhereGroup(string $sGroup, string $sField, mixed $mRestriction, string $sOperator)
string
string
mixed
string
_buildGroupWhereStatements() : array
arrayWith all where statements_buildWhereStatements() : array
arrayWith all where statements_delete(mixed $mId) : bool
mixedId of entry to delete
bool_fetchJoinTables(\??? $ignoreRoot) : array
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
| todo | Reduce complexity of this function, to much code... |
|---|
\???
arrayArray structure, see above_findReverseJoinPartner(string $sParentClass, string $sClassName)
string
string
_getPropertiesCollectionInstance() : \PropertyCollection
| inherited_from | \Contenido_ItemBaseAbstract::_getPropertiesCollectionInstance() |
|---|
_getSecondDBInstance() : \DB_Contenido
_initializeDriver(\$bForceInit $bForceInit)
\$bForceInitboolean If true, forces the driver to initialize, even if it already exists.
_recursiveStructuredFetch(array $aObjects, array $aResult)
_resolveLinks() : array
array_setItemClass(string $sClassName) : void
stringSpecifies the classname of item
_setJoinPartner(string $sForeignCollectionClass) : void
Important: The class specified by $sForeignCollectionClass 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
$primaryKey : string
| inherited_from | \Contenido_ItemBaseAbstract::$$primaryKey |
|---|
$virgin : bool
| inherited_from | \Contenido_ItemBaseAbstract::$$virgin |
|---|
$_JoinPartners : array
$_aOperators : array
$_bAllMode : bool
$_className : string
| inherited_from | \Contenido_ItemBaseAbstract::$$_className |
|---|
$_collectionCache : array
$_encoding : string
$_forwardJoinPartners : array
$_groupConditions : array
$_innerGroupConditions : array
$_itemClass : string
$_iteratorItem : object
$_oCache : \Contenido_ItemCache
| inherited_from | \Contenido_ItemBaseAbstract::$$_oCache |
|---|
$_resultFields : array
$_settings : array
| inherited_from | \Contenido_ItemBaseAbstract::$$_settings |
|---|
$_whereRestriction : array
$cache : array
| inherited_from | \Contenido_ItemBaseAbstract::$$cache |
|---|
$db : \DB_Contenido
| inherited_from | \Contenido_ItemBaseAbstract::$$db |
|---|
$lasterror : string
| inherited_from | \Contenido_ItemBaseAbstract::$$lasterror |
|---|
$lifetime : int
| inherited_from | \Contenido_ItemBaseAbstract::$$lifetime |
|---|
$objects : string
$properties : \PropertyCollection
| inherited_from | \Contenido_ItemBaseAbstract::$$properties |
|---|
$secondDb : \DB_Contenido
| inherited_from | \Contenido_ItemBaseAbstract::$$secondDb |
|---|
$table : string
| inherited_from | \Contenido_ItemBaseAbstract::$$table |
|---|