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() |
|---|
intNumber 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');
mixedType of the item (example: idcat)
mixedID of the item (example: 31)
mixedType of the data to store (arbitary data)
mixedEntry name
mixedValue
boolOptionally 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() |
|---|
mixedId of entry to delete
booldeleteBy(string $sField, mixed $mValue) : int
Deletes also cached e entries and any existing properties.
| inherited_from | \ItemCollection::deleteBy() |
|---|
stringThe field name
mixedThe value of the field
intNumber of deleted entriesdeleteByWhereClause(string $sWhere) : int
Deletes also cached e entries and any existing properties.
| inherited_from | \ItemCollection::deleteByWhereClause() |
|---|
stringThe where clause of the SQL statement
intNumber of deleted entriesdeleteProperties(mixed $itemtype, mixed $itemid)
mixedType of the item (example: idcat)
mixedID of the item (example: 31)
deleteValue(mixed $itemtype, mixed $itemid, mixed $type, mixed $name)
Example:
$properties->deleteValue('idcat', 27, 'visual', 'image');
mixedType of the item (example: idcat)
mixedID of the item (example: 31)
mixedType of the data to store (arbitary data)
mixedEntry 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() |
stringThe string to escape
stringEscaped stringexists(mixed $mId) : bool
| inherited_from | \ItemCollection::exists() |
|---|
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.
| inherited_from | \ItemCollection::fetchArray() |
|---|
stringName of the field to use for the key
mixedString or array
arrayResulting arrayfetchById(string | int $id) : \Item
| inherited_from | \ItemCollection::fetchById() |
|---|
stringintThe primary key of the item to load.
\ItemThe 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() |
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 falsegetAllValues(mixed $field, mixed $fieldValue, \Contenido_Auth $auth) : array
mixedField to search in
mixedValue to search for
arrayFor each given itemgetProperties(mixed $itemtype, mixed $itemid) : array
mixedType of the item (example: idcat)
mixedID of the item (example: 31)
arrayFor each given itemgetValue(mixed $itemtype, mixed $itemid, mixed $type, mixed $name, $default) : mixed
Example:
$file = $properties->getValue('idcat', 27, 'visual', 'image');
mixedType of the item (example: idcat)
mixedID of the item (example: 31)
mixedType of the data to store (arbitary data)
mixedEntry name
mixedValuegetValuesByType(mixed $itemtype, mixed $itemid, mixed $type) : array
Example:
$file = $properties->getValuesByType('idcat', 27, 'visual');
mixedType of the item (example: idcat)
mixedID of the item (example: 31)
mixedType of the data to store (arbitary data)
arrayValuelink(string $sForeignClass)
| inherited_from | \ItemCollection::link() |
|---|
stringThe class of foreign table to use
loadItem(mixed $mItem) : \Item
| inherited_from | \ItemCollection::loadItem() |
|---|
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
| inherited_from | \ItemCollection::next() |
|---|
\ItemboolThe next object, or false if no more objectsquery() : bool
| inherited_from | \ItemCollection::query() |
|---|
boolqueryAndFetchStructured(array $aObjects) : array
| inherited_from | \ItemCollection::queryAndFetchStructured() |
|---|
arrayWith the correct order of the objects
arrayResultremoveResultField(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() |
|---|
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)
| 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');
mixedType of the item (example: idcat)
mixedID of the item (example: 31)
mixedType of the data to store (arbitary data)
mixedEntry name
mixedValue
intId 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() |
|---|
arrayWith all where statements_buildWhereStatements() : array
| inherited_from | \ItemCollection::_buildWhereStatements() |
|---|
arrayWith all where statements_delete(mixed $mId) : bool
| inherited_from | \ItemCollection::_delete() |
|---|
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
| inherited_from | \ItemCollection::_fetchJoinTables() |
|---|
\???
arrayArray 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() |
|---|
\$bForceInitboolean 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() |
|---|
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.
| inherited_from | \ItemCollection::_setJoinPartner() |
|---|
stringSpecifies 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 |