PropertyCollection()
__construct()
addResultField()
changeClient()
count()
create()
delete()
deleteBy()
deleteByWhereClause()
deleteProperties()
deleteValue()
deleteWhere()
deleteWhereGroup()
escape()
exists()
fetchArray()
fetchById()
fetchObject()
fetchTable()
flexSelect()
getAllValues()
getProperties()
getValue()
getValuesByType()
link()
loadItem()
next()
query()
queryAndFetchStructured()
removeResultField()
resetQuery()
select()
setEncoding()
setGroupCondition()
setInnerGroupCondition()
setLimit()
setOrder()
setValue()
setWhere()
setWhereGroup()
_buildGroupWhereStatements()
_buildWhereStatements()
_delete()
_fetchJoinTables()
_findReverseJoinPartner()
_getPropertiesCollectionInstance()
_getSecondDBInstance()
_initializeDriver()
_recursiveStructuredFetch()
_resolveLinks()
_setItemClass()
_setJoinPartner()
$client
$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 |
PropertyCollection()
deprecated | [2011-03-15] Old constructor function for downwards compatibility |
---|
__construct()
\Contenido_ItemException |
If table name or primary key is not set |
---|
addResultField(string $sField)
inherited_from | \ItemCollection::addResultField() |
---|
string
changeClient($idclient)
count() : int
inherited_from | \ItemCollection::count() |
---|
int
Number of rowscreate(mixed $itemtype, mixed $itemid, mixed $type, mixed $name, mixed $value, bool $bInternally) : \PropertyItem
Example:
$properties->create('idcat', 27, 'visual', 'image', 'images/tool.gif');
mixed
Type of the item (example: idcat)
mixed
ID of the item (example: 31)
mixed
Type of the data to store (arbitary data)
mixed
Entry name
mixed
Value
bool
Optionally default false (on internal call do not escape parameters again
delete(mixed $mId) : bool
Deletes also cached e entry and any existing properties.
inherited_from | \ItemCollection::delete() |
---|
mixed
Id of entry to delete
bool
deleteBy(string $sField, mixed $mValue) : int
Deletes also cached e entries and any existing properties.
inherited_from | \ItemCollection::deleteBy() |
---|
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.
inherited_from | \ItemCollection::deleteByWhereClause() |
---|
string
The where clause of the SQL statement
int
Number of deleted entriesdeleteProperties(mixed $itemtype, mixed $itemid)
mixed
Type of the item (example: idcat)
mixed
ID of the item (example: 31)
deleteValue(mixed $itemtype, mixed $itemid, mixed $type, mixed $name)
Example:
$properties->deleteValue('idcat', 27, 'visual', 'image');
mixed
Type of the item (example: idcat)
mixed
ID of the item (example: 31)
mixed
Type of the data to store (arbitary data)
mixed
Entry name
deleteWhere(string $sField, mixed $mRestriction, string $sOperator)
inherited_from | \ItemCollection::deleteWhere() |
---|
string
mixed
string
deleteWhereGroup(string $sGroup, string $sField, mixed $mRestriction, string $sOperator)
inherited_from | \ItemCollection::deleteWhereGroup() |
---|
string
string
mixed
string
escape(string $sString) : string
inherited_from | \Contenido_ItemBaseAbstract::escape() |
---|---|
inherited_from | \ItemCollection::escape() |
string
The string to escape
string
Escaped stringexists(mixed $mId) : bool
inherited_from | \ItemCollection::exists() |
---|
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.
inherited_from | \ItemCollection::fetchArray() |
---|
string
Name of the field to use for the key
mixed
String or array
array
Resulting arrayfetchById(string | int $id) : \Item
inherited_from | \ItemCollection::fetchById() |
---|
stringint
The primary key of the item to load.
\Item
The loaded itemfetchObject($sClassName)
inherited_from | \ItemCollection::fetchObject() |
---|
Item
fetchTable(array $aFields, array $aObjects)
inherited_from | \ItemCollection::fetchTable() |
---|
flexSelect(string $sDistinct, string $sFrom, string $sWhere, string $sGroupBy, string $sOrderBy, string $sLimit) : bool
author | HerrB |
---|---|
inherited_from | \ItemCollection::flexSelect() |
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 falsegetAllValues(mixed $field, mixed $fieldValue, \Contenido_Auth $auth) : array
mixed
Field to search in
mixed
Value to search for
array
For each given itemgetProperties(mixed $itemtype, mixed $itemid) : array
mixed
Type of the item (example: idcat)
mixed
ID of the item (example: 31)
array
For each given itemgetValue(mixed $itemtype, mixed $itemid, mixed $type, mixed $name, $default) : mixed
Example:
$file = $properties->getValue('idcat', 27, 'visual', 'image');
mixed
Type of the item (example: idcat)
mixed
ID of the item (example: 31)
mixed
Type of the data to store (arbitary data)
mixed
Entry name
mixed
ValuegetValuesByType(mixed $itemtype, mixed $itemid, mixed $type) : array
Example:
$file = $properties->getValuesByType('idcat', 27, 'visual');
mixed
Type of the item (example: idcat)
mixed
ID of the item (example: 31)
mixed
Type of the data to store (arbitary data)
array
Valuelink(string $sForeignClass)
inherited_from | \ItemCollection::link() |
---|
string
The class of foreign table to use
loadItem(mixed $mItem) : \Item
inherited_from | \ItemCollection::loadItem() |
---|
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
inherited_from | \ItemCollection::next() |
---|
\Item
bool
The next object, or false if no more objectsquery() : bool
inherited_from | \ItemCollection::query() |
---|
bool
queryAndFetchStructured(array $aObjects) : array
inherited_from | \ItemCollection::queryAndFetchStructured() |
---|
array
With the correct order of the objects
array
ResultremoveResultField(string $sField)
inherited_from | \ItemCollection::removeResultField() |
---|
string
resetQuery()
inherited_from | \ItemCollection::resetQuery() |
---|
select(string $sWhere, string $sGroupBy, string $sOrderBy, string $sLimit) : bool
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.
bool
True on success, otherwhise falsesetEncoding(string $sEncoding)
inherited_from | \ItemCollection::setEncoding() |
---|
string
setGroupCondition(string $sGroup1, string $sGroup2, string $sCondition)
inherited_from | \ItemCollection::setGroupCondition() |
---|
string
string
string
setInnerGroupCondition(string $sGroup, string $sCondition)
inherited_from | \ItemCollection::setInnerGroupCondition() |
---|
string
string
setLimit(int $iRowStart, int $iRowCount)
inherited_from | \ItemCollection::setLimit() |
---|
int
int
setOrder(string $order)
inherited_from | \ItemCollection::setOrder() |
---|
string
setValue(mixed $itemtype, mixed $itemid, mixed $type, mixed $name, mixed $value, int $idProp)
Example:
$properties->setValue('idcat', 27, 'visual', 'image', 'images/tool.gif');
mixed
Type of the item (example: idcat)
mixed
ID of the item (example: 31)
mixed
Type of the data to store (arbitary data)
mixed
Entry name
mixed
Value
int
Id of database record (if set, update on this basis (possiblity to update name value and type))
setWhere(string $sField, mixed $mRestriction, string $sOperator)
inherited_from | \ItemCollection::setWhere() |
---|
string
mixed
string
setWhereGroup(string $sGroup, string $sField, mixed $mRestriction, string $sOperator)
inherited_from | \ItemCollection::setWhereGroup() |
---|
string
string
mixed
string
_buildGroupWhereStatements() : array
inherited_from | \ItemCollection::_buildGroupWhereStatements() |
---|
array
With all where statements_buildWhereStatements() : array
inherited_from | \ItemCollection::_buildWhereStatements() |
---|
array
With all where statements_delete(mixed $mId) : bool
inherited_from | \ItemCollection::_delete() |
---|
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
inherited_from | \ItemCollection::_fetchJoinTables() |
---|
\???
array
Array structure, see above_findReverseJoinPartner(string $sParentClass, string $sClassName)
inherited_from | \ItemCollection::_findReverseJoinPartner() |
---|
string
string
_getPropertiesCollectionInstance() : \PropertyCollection
inherited_from | \Contenido_ItemBaseAbstract::_getPropertiesCollectionInstance() |
---|---|
inherited_from | \ItemCollection::_getPropertiesCollectionInstance() |
_getSecondDBInstance() : \DB_Contenido
inherited_from | \Contenido_ItemBaseAbstract::_getSecondDBInstance() |
---|---|
inherited_from | \ItemCollection::_getSecondDBInstance() |
_initializeDriver(\$bForceInit $bForceInit)
inherited_from | \ItemCollection::_initializeDriver() |
---|
\$bForceInit
boolean If true, forces the driver to initialize, even if it already exists.
_recursiveStructuredFetch(array $aObjects, array $aResult)
inherited_from | \ItemCollection::_recursiveStructuredFetch() |
---|
_resolveLinks() : array
inherited_from | \ItemCollection::_resolveLinks() |
---|
array
_setItemClass(string $sClassName) : void
inherited_from | \ItemCollection::_setItemClass() |
---|
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.
inherited_from | \ItemCollection::_setJoinPartner() |
---|
string
Specifies the foreign class to use
$client
$primaryKey : string
inherited_from | \Contenido_ItemBaseAbstract::$$primaryKey |
---|---|
inherited_from | \ItemCollection::$$primaryKey |
$virgin : bool
inherited_from | \Contenido_ItemBaseAbstract::$$virgin |
---|---|
inherited_from | \ItemCollection::$$virgin |
$_JoinPartners : array
inherited_from | \ItemCollection::$$_JoinPartners |
---|
$_aOperators : array
inherited_from | \ItemCollection::$$_aOperators |
---|
$_bAllMode : bool
inherited_from | \ItemCollection::$$_bAllMode |
---|
$_className : string
inherited_from | \Contenido_ItemBaseAbstract::$$_className |
---|---|
inherited_from | \ItemCollection::$$_className |
$_collectionCache : array
inherited_from | \ItemCollection::$$_collectionCache |
---|
$_encoding : string
inherited_from | \ItemCollection::$$_encoding |
---|
$_forwardJoinPartners : array
inherited_from | \ItemCollection::$$_forwardJoinPartners |
---|
$_groupConditions : array
inherited_from | \ItemCollection::$$_groupConditions |
---|
$_innerGroupConditions : array
inherited_from | \ItemCollection::$$_innerGroupConditions |
---|
$_itemClass : string
inherited_from | \ItemCollection::$$_itemClass |
---|
$_iteratorItem : object
inherited_from | \ItemCollection::$$_iteratorItem |
---|
$_oCache : \Contenido_ItemCache
inherited_from | \Contenido_ItemBaseAbstract::$$_oCache |
---|---|
inherited_from | \ItemCollection::$$_oCache |
$_resultFields : array
inherited_from | \ItemCollection::$$_resultFields |
---|
$_settings : array
inherited_from | \Contenido_ItemBaseAbstract::$$_settings |
---|---|
inherited_from | \ItemCollection::$$_settings |
$_whereRestriction : array
inherited_from | \ItemCollection::$$_whereRestriction |
---|
$cache : array
inherited_from | \Contenido_ItemBaseAbstract::$$cache |
---|---|
inherited_from | \ItemCollection::$$cache |
$db : \DB_Contenido
inherited_from | \Contenido_ItemBaseAbstract::$$db |
---|---|
inherited_from | \ItemCollection::$$db |
$lasterror : string
inherited_from | \Contenido_ItemBaseAbstract::$$lasterror |
---|---|
inherited_from | \ItemCollection::$$lasterror |
$lifetime : int
inherited_from | \Contenido_ItemBaseAbstract::$$lifetime |
---|---|
inherited_from | \ItemCollection::$$lifetime |
$objects : string
inherited_from | \ItemCollection::$$objects |
---|
$properties : \PropertyCollection
inherited_from | \Contenido_ItemBaseAbstract::$$properties |
---|---|
inherited_from | \ItemCollection::$$properties |
$secondDb : \DB_Contenido
inherited_from | \Contenido_ItemBaseAbstract::$$secondDb |
---|---|
inherited_from | \ItemCollection::$$secondDb |
$table : string
inherited_from | \Contenido_ItemBaseAbstract::$$table |
---|---|
inherited_from | \ItemCollection::$$table |