Methods summary
public
|
#
__construct( integer $idclient = 0 )
Constructor function
Parameters
- $idclient
integer $idclient Client id
Throws
Overrides
|
public static
|
#
reset( )
Resets the states of static properties.
Resets the states of static properties.
|
public
cApiProperty
|
#
create( mixed $itemtype, mixed $itemid, mixed $type, mixed $name, mixed $value, boolean $bDontEscape = false )
Creates a new property item.
Creates a new property item.
Example:
$properties = new cApiPropertyCollection($clientid);
$property = $properties->create('idcat', 27, 'visual', 'image', 'images/tool.gif');
Parameters
- $itemtype
mixed $itemtype Type of the item (example: idcat)
- $itemid
mixed $itemid ID of the item (example: 31)
- $type
mixed $type Type of the data to store (arbitary data)
- $name
mixed $name Entry name
- $value
mixed $value Value
- $bDontEscape
boolean $bDontEscape Optionally default false (on internal call do not escape parameters
again
Returns
|
public
mixed
|
#
getValue( mixed $itemtype, mixed $itemid, mixed $type, mixed $name, mixed $default = false )
Returns the value for a given item.
Returns the value for a given item.
Example:
$properties = new cApiPropertyCollection($clientid);
$value = $properties->getValue('idcat', 27, 'visual', 'image');
Parameters
- $itemtype
mixed $itemtype Type of the item (example: idcat)
- $itemid
mixed $itemid ID of the item (example: 31)
- $type
mixed $type Type of the data to store (arbitary data)
- $name
mixed $name Entry name
- $default
Returns
mixed Value
|
public
array
|
#
getValuesByType( mixed $itemtype, mixed $itemid, mixed $type )
Returns the value for a given item.
Returns the value for a given item.
Example:
$properties = new cApiPropertyCollection($clientid);
$values = $properties->getValuesByType('idcat', 27, 'visual');
Parameters
- $itemtype
mixed $itemtype Type of the item (example: idcat)
- $itemid
mixed $itemid ID of the item (example: 31)
- $type
mixed $type Type of the data to store (arbitary data)
Returns
array Value
|
public
array
|
#
getValuesOnlyByTypeName( mixed $type, mixed $name )
Returns the values only by type and name.
Returns the values only by type and name.
Example:
$properties = new cApiPropertyCollection($clientid);
$values = $properties->getValuesOnlyByTypeName('note', 'category');
Parameters
- $type
mixed $itemtype Type of the item (example: idcat)
- $name
mixed $name Type of the data to store (arbitary data)
Returns
array Value
|
public
|
#
setValue( mixed $itemtype, mixed $itemid, mixed $type, mixed $name, mixed $value, integer $idProp = 0 )
Sets a property item. Handles creation and updating. Existing item will be
updated, not existing item will be created.
Sets a property item. Handles creation and updating. Existing item will be
updated, not existing item will be created.
Example:
$properties = new cApiPropertyCollection($clientid);
$properties->setValue('idcat', 27, 'visual', 'image', 'images/tool.gif');
Parameters
- $itemtype
mixed $itemtype Type of the item (example: idcat)
- $itemid
mixed $itemid ID of the item (example: 31)
- $type
mixed $type Type of the data to store (arbitary data)
- $name
mixed $name Entry name
- $value
mixed $value Value
- $idProp
integer $idProp Id of database record (if set, update on this basis (possiblity to
update name value and type))
|
public
|
#
deleteValue( mixed $itemtype, mixed $itemid, mixed $type, mixed $name )
Delete a property item.
Example:
$properties = new cApiPropertyCollection($clientid);
$properties->deleteValue('idcat', 27, 'visual', 'image');
Parameters
- $itemtype
mixed $itemtype Type of the item (example: idcat)
- $itemid
mixed $itemid ID of the item (example: 31)
- $type
mixed $type Type of the data to store (arbitary data)
- $name
mixed $name Entry name
|
public
array
|
#
getProperties( mixed $itemtype, mixed $itemid )
Checks if values for a given item are available.
Checks if values for a given item are available.
Parameters
- $itemtype
mixed $itemtype Type of the item (example: idcat)
- $itemid
mixed $itemid ID of the item (example: 31)
Returns
array For each given item
|
public
array
|
#
getAllValues( mixed $field, mixed $fieldValue, cAuth $auth = NULL )
Returns all datasets selected by given field and value combination
Returns all datasets selected by given field and value combination
Parameters
- $field
mixed $field Field to search in
- $fieldValue
mixed $fieldValue Value to search for
- $auth
cAuth
$auth Narrow result down to user in auth objext
Returns
array For each given item
|
public
|
#
deleteProperties( mixed $itemtype, mixed $itemid )
Delete all properties which match itemtype and itemid
Delete all properties which match itemtype and itemid
Parameters
- $itemtype
mixed $itemtype Type of the item (example: idcat)
- $itemid
mixed $itemid ID of the item (example: 31)
|
public
|
#
deletePropertiesMultiple( mixed $itemtype, array $itemids )
Delete all properties which match itemtype and multiple itemids.
Delete all properties which match itemtype and multiple itemids.
Parameters
- $itemtype
mixed $itemtype Type of the item (example: idcat)
- $itemids
array $itemids Ids of multiple items (example: array(31,12,22))
|
public
|
#
changeClient( integer $idclient )
Changes the client
Parameters
- $idclient
integer $idclient
|
protected
|
#
_loadFromCache( )
Loads/Caches configured properties.
Loads/Caches configured properties.
|
protected
|
#
_useCache( mixed $itemtype = null, mixed $itemid = null )
|
protected
|
#
_deletePropertiesByIds( array $ids )
Deletes multiple property entries by their ids. Deletes them also from
internal cache.
Deletes multiple property entries by their ids. Deletes them also from
internal cache.
Parameters
|
protected
|
|
protected
|
#
_deleteFromCache( integer $id )
Removes a entry from cache.
Removes a entry from cache.
Parameters
|
protected
|
#
_deleteFromCacheMultiple( array $ids )
Removes multiple entries from cache.
Removes multiple entries from cache.
Parameters
|
protected
mixed
|
#
_getValueFromCache( mixed $itemtype, mixed $itemid, mixed $type, mixed $name, mixed $default = false )
Returns the value for a given item from cache.
Returns the value for a given item from cache.
Parameters
- $itemtype
mixed $itemtype Type of the item (example: idcat)
- $itemid
mixed $itemid ID of the item (example: 31)
- $type
mixed $type Type of the data to store (arbitary data)
- $name
mixed $name Entry name
- $default
Returns
mixed Value
|
protected
array
|
#
_getValuesByTypeFromCache( mixed $itemtype, mixed $itemid, mixed $type )
Returns the values for a given item by its type from cache.
Returns the values for a given item by its type from cache.
Parameters
- $itemtype
mixed $itemtype Type of the item (example: idcat)
- $itemid
mixed $itemid ID of the item (example: 31)
- $type
mixed $type Type of the data to store (arbitary data)
Returns
array Value
|
public
array
|
#
_getPropertiesFromCache( mixed $itemtype, mixed $itemid )
Returns poperties for given item are available.
Returns poperties for given item are available.
Parameters
- $itemtype
mixed $itemtype Type of the item (example: idcat)
- $itemid
mixed $itemid ID of the item (example: 31)
Returns
array For each given item
|