__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)
string
The table to use as information source
string
The primary key to use
int
\Contenido_ItemException |
If table name or primary key is not set |
---|
addResultField(string $sField)
string
count() : int
int
Number of rowscreate() : \Item
\Item
The newly created objectdelete(mixed $mId) : bool
Deletes also cached e entry and any existing properties.
mixed
Id of entry to delete
bool
deleteBy(string $sField, mixed $mValue) : int
Deletes also cached e entries and any existing properties.
string
The field name
mixed
The value of the field
int
Number of deleted entriesdeleteByWhereClause(string $sWhere) : int
Deletes also cached e entries and any existing properties.
string
The where clause of the SQL statement
int
Number 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() |
---|
string
The string to escape
string
Escaped stringexists(mixed $mId) : bool
mixed
The id to check for (could be numeric or string)
bool
True 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.
string
Name of the field to use for the key
mixed
String or array
array
Resulting arrayfetchObject($sClassName)
Item
fetchTable(array $aFields, array $aObjects)
flexSelect(string $sDistinct, string $sFrom, string $sWhere, string $sGroupBy, string $sOrderBy, string $sLimit) : bool
author | HerrB |
---|
string
Specifies if distinct will be added to the SQL statement ($sDistinct !== '' -> 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.
bool
True on success, otherwhise falselink(string $sForeignClass)
string
The class of foreign table to use
loadItem(mixed $mItem) : \Item
mixed
The 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 |
---|
\Item
The newly created objectnext() : \Item | bool
\Item
bool
The next object, or false if no more objectsquery() : bool
bool
queryAndFetchStructured(array $aObjects) : array
array
With the correct order of the objects
array
ResultremoveResultField(string $sField)
string
resetQuery()
select(string $sWhere, string $sGroupBy, string $sOrderBy, string $sLimit) : bool
string
Specifies the where clause.
string
Specifies the group by clause.
string
Specifies the order by clause.
string
Specifies the limit by clause.
bool
True 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
array
With all where statements_buildWhereStatements() : array
array
With all where statements_delete(mixed $mId) : bool
mixed
Id 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... |
---|
\???
array
Array structure, see above_findReverseJoinPartner(string $sParentClass, string $sClassName)
string
string
_getPropertiesCollectionInstance() : \PropertyCollection
inherited_from | \Contenido_ItemBaseAbstract::_getPropertiesCollectionInstance() |
---|
_getSecondDBInstance() : \DB_Contenido
_initializeDriver(\$bForceInit $bForceInit)
\$bForceInit
boolean If true, forces the driver to initialize, even if it already exists.
_recursiveStructuredFetch(array $aObjects, array $aResult)
_resolveLinks() : array
array
_setItemClass(string $sClassName) : void
string
Specifies 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.
string
Specifies 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 |
---|