CSObjectUserDatasource
extends CSObjectItemDatasource
in package
Represents a datasource interface for the object chooser.
Tags
Table of Contents
- ATTRIBUTE_EXTERNALKEY = 'ExternalKey'
- ATTRIBUTE_ISFOLDER = 'IsFolder'
- ATTRIBUTE_LASTCHANGE = 'LastChange'
- ATTRIBUTE_OBJECTTYPEID = 'ObjecttypeID'
- ATTRIBUTE_OWNERID = 'OwnerID'
- ATTRIBUTE_STATEID = 'StateID'
- ATTRIBUTE_TAGS = 'Tags'
- SELECTION_TYPE_ACCESS_RIGHT_MODE_ADD = 1
- constant for selection type add right access
- SELECTION_TYPE_ACCESS_RIGHT_MODE_REMOVE = 2
- constant for selection type remove right access
- SELECTION_TYPE_ACCESS_RIGHT_MODE_REPLACE = 0
- constant for selection type replace right access
- SELECTION_TYPE_CHILDREN = 1
- constant for selection type children
- SELECTION_TYPE_CHILDREN_RECURSIVE = 3
- constant for selection type children recursive
- SELECTION_TYPE_CHILDREN_RECURSIVE_WITH_PARENT = 4
- constant for selection type children recursive with parent
- SELECTION_TYPE_CHILDREN_WITH_PARENT = 2
- constant for selection type children with parent
- configureMassAction() : array<string|int, mixed>
- Executes the configuration for the specific mass action based on the selection.
- copyRecordToTarget() : int
- Copies the source record to provided target
- deleteRecord() : bool
- Deletes the record
- executeMassAction() : CSObjectDatasourceMassActionResult
- Executes the specified mass action on the records with the specified ids
- getAvailableMassActions() : array<string|int, mixed>
- Returns all available mass actions defined withing the datasource
- getDataForRecord() : array<string|int, mixed>
- Abstract method to get the data of the specified record.
- getDatasourceForRecord() : CSObjectDatasource
- Returns the matching datasource object for the given record.
- getDefaultListAttributes() : array<string|int, mixed>
- Returns the attributes for which data needs to displayed in studio list
- getDefaultSortOrderForParentIds() : array<string|int, mixed>
- Returns the default sort order for the datasource record based on the parent id list.
- getIconForRecord() : string
- Abstract method to get the icon of the specified record.
- getIconForRecordId() : string
- Fetches the icon path of the requested record identified by its ID
- getLabelForRecord() : string
- Abstract method to get the label of the specified record.
- getLabelPathForRecord() : array<string|int, mixed>
- Abstract method to get the label path for the specified record.
- getPreviewForRecord() : string
- Abstract method to get the preview image of the specified record.
- getPreviewForRecordId() : string
- Abstract method to get the preview image of the record specified by the id.
- getRecordAttributeValues() : array<string|int, mixed>
- Fetches the values for the requested attributes of the item for the current data language of the item
- getRecordForId() : Record
- Returns the record for the specified id.
- getRecordIdsForParentId() : array<string|int, mixed>
- Abstract method to get all record ids for a particular parent id.
- getRecordsForIds() : array<string|int, mixed>
- Abstract method to get all records for a list of ids.
- getRecordsForParentId() : array<string|int, mixed>
- Abstract method to get all records for a particular parent id.
- getSupportedSelectionTypesForRecord() : array<string|int, mixed>
- Returns all available selection types for the datasource.
- isRecordAFolder() : bool
- Abstract method to evaluate whether the specified record is a folder or not.
- isRecordDisabled() : bool
- Abstract method to evaluate whether the specified record is disabled.
- isValidDataString() : bool
- Checks whether the passed data string is valid for the current datasource.
- mayViewRecord() : bool
- Abstract method to evaluate whether the specified record is visible in the current context.
- search() : array<string|int, mixed>
- Abstract method to execute a search on a datasource record.
- searchIds() : array<string|int, mixed>
- Abstract method to execute a search on a datasource record.
- searchIdsWithFilter() : CSItemSearchResult
- Searches all items matching a given search criteria
Constants
ATTRIBUTE_EXTERNALKEY
public
mixed
ATTRIBUTE_EXTERNALKEY
= 'ExternalKey'
Tags
ATTRIBUTE_ISFOLDER
public
mixed
ATTRIBUTE_ISFOLDER
= 'IsFolder'
Tags
ATTRIBUTE_LASTCHANGE
public
mixed
ATTRIBUTE_LASTCHANGE
= 'LastChange'
Tags
ATTRIBUTE_OBJECTTYPEID
public
mixed
ATTRIBUTE_OBJECTTYPEID
= 'ObjecttypeID'
Tags
ATTRIBUTE_OWNERID
public
mixed
ATTRIBUTE_OWNERID
= 'OwnerID'
Tags
ATTRIBUTE_STATEID
public
mixed
ATTRIBUTE_STATEID
= 'StateID'
Tags
ATTRIBUTE_TAGS
public
mixed
ATTRIBUTE_TAGS
= 'Tags'
Tags
SELECTION_TYPE_ACCESS_RIGHT_MODE_ADD
constant for selection type add right access
public
mixed
SELECTION_TYPE_ACCESS_RIGHT_MODE_ADD
= 1
Tags
SELECTION_TYPE_ACCESS_RIGHT_MODE_REMOVE
constant for selection type remove right access
public
mixed
SELECTION_TYPE_ACCESS_RIGHT_MODE_REMOVE
= 2
Tags
SELECTION_TYPE_ACCESS_RIGHT_MODE_REPLACE
constant for selection type replace right access
public
mixed
SELECTION_TYPE_ACCESS_RIGHT_MODE_REPLACE
= 0
Tags
SELECTION_TYPE_CHILDREN
constant for selection type children
public
mixed
SELECTION_TYPE_CHILDREN
= 1
Tags
SELECTION_TYPE_CHILDREN_RECURSIVE
constant for selection type children recursive
public
mixed
SELECTION_TYPE_CHILDREN_RECURSIVE
= 3
Tags
SELECTION_TYPE_CHILDREN_RECURSIVE_WITH_PARENT
constant for selection type children recursive with parent
public
mixed
SELECTION_TYPE_CHILDREN_RECURSIVE_WITH_PARENT
= 4
Tags
SELECTION_TYPE_CHILDREN_WITH_PARENT
constant for selection type children with parent
public
mixed
SELECTION_TYPE_CHILDREN_WITH_PARENT
= 2
Tags
Methods
configureMassAction()
Executes the configuration for the specific mass action based on the selection.
public
final configureMassAction(string $sAction, CSMassActionContext $oContext, array<string|int, mixed> $aIds) : array<string|int, mixed>
Parameters
- $sAction : string
-
The mass action name to execute
- $oContext : CSMassActionContext
-
The context of mass action
- $aIds : array<string|int, mixed>
-
The list of record ids on which to execute the mass action
Tags
Return values
array<string|int, mixed> —Custom configuration data for the mass action.
copyRecordToTarget()
Copies the source record to provided target
public
copyRecordToTarget(Record $oSourceRecord, Record $oTargetRecord) : int
Parameters
- $oSourceRecord : Record
-
The source record
- $oTargetRecord : Record
-
The target folder
Tags
Return values
int —ID of the copied record
deleteRecord()
Deletes the record
public
deleteRecord(Record $oRecord) : bool
Parameters
- $oRecord : Record
-
The record to be deleted
Tags
Return values
bool —TRUE if record was deleted, FALSE, Otherwise.
executeMassAction()
Executes the specified mass action on the records with the specified ids
public
final executeMassAction(string $sAction, CSMassActionContext $oContext, array<string|int, mixed> $aIds[, array<string|int, mixed> $aParameters = array() ]) : CSObjectDatasourceMassActionResult
Parameters
- $sAction : string
-
The mass action name to execute
- $oContext : CSMassActionContext
-
The context of mass action
- $aIds : array<string|int, mixed>
-
The list of record ids on which to execute the mass action
- $aParameters : array<string|int, mixed> = array()
-
List of parameters passed to the mass action as key/value pairs.
Tags
Return values
CSObjectDatasourceMassActionResult —The result of the executed mass action
getAvailableMassActions()
Returns all available mass actions defined withing the datasource
public
final getAvailableMassActions(CSMassActionContext $oContext) : array<string|int, mixed>
Parameters
- $oContext : CSMassActionContext
-
The context of mass action execution
Tags
Return values
array<string|int, mixed> —List of action definitions
getDataForRecord()
Abstract method to get the data of the specified record.
public
getDataForRecord(mixed $oRecord[, mixed $bExtended = false ][, mixed $iLanguageId = null ][, mixed $iContextId = null ]) : array<string|int, mixed>
Parameters
- $oRecord : mixed
-
The record for which the data should be returned.
- $bExtended : mixed = false
-
When set to true, the entire detailed information of the record is retrieved, including formatted, unformatted values as well as inheritance information.
- $iLanguageId : mixed = null
-
Optional parameter that enables the method to retrieve the item information in another language other than the current one.
- $iContextId : mixed = null
-
Optional parameter that enables the method to retrieve the item information in a specific context.
Tags
Return values
array<string|int, mixed> —The data of the specified record.
getDatasourceForRecord()
Returns the matching datasource object for the given record.
public
final static getDatasourceForRecord(Record $oRecord) : CSObjectDatasource
Parameters
- $oRecord : Record
-
The record for which the datasource object should be returned.
Tags
Return values
CSObjectDatasource —The datasource object for the given record.
getDefaultListAttributes()
Returns the attributes for which data needs to displayed in studio list
public
getDefaultListAttributes() : array<string|int, mixed>
Tags
Return values
array<string|int, mixed> —getDefaultSortOrderForParentIds()
Returns the default sort order for the datasource record based on the parent id list.
public
getDefaultSortOrderForParentIds([array<string|int, mixed> $aParentIds = array() ]) : array<string|int, mixed>
Parameters
- $aParentIds : array<string|int, mixed> = array()
-
The parent id list as context for the sort order
Tags
Return values
array<string|int, mixed> —List of sort order fields and their corresponding order mode
getIconForRecord()
Abstract method to get the icon of the specified record.
public
getIconForRecord(mixed $oRecord) : string
Parameters
- $oRecord : mixed
-
The record for which the icon should be returned.
Tags
Return values
string —The icon of the specified record relative to the admin folder..
getIconForRecordId()
Fetches the icon path of the requested record identified by its ID
public
getIconForRecordId(int $iRecordId) : string
Internally fetches the ImageServerUrl of the requested item (without instanciating its object)
Parameters
- $iRecordId : int
-
ID of the requested record
Tags
Return values
string —Path of the icon of the record
getLabelForRecord()
Abstract method to get the label of the specified record.
public
getLabelForRecord(mixed $oRecord) : string
Parameters
- $oRecord : mixed
-
The record for which the label should be returned.
Tags
Return values
string —The label of the specified record.
getLabelPathForRecord()
Abstract method to get the label path for the specified record.
public
getLabelPathForRecord(mixed $oRecord) : array<string|int, mixed>
Parameters
- $oRecord : mixed
-
The record for which the label path should be returned.
Tags
Return values
array<string|int, mixed> —The label path.
getPreviewForRecord()
Abstract method to get the preview image of the specified record.
public
getPreviewForRecord(Record $oRecord[, int|null $iWidth = null ][, int|null $iHeight = null ]) : string
Parameters
- $oRecord : Record
-
The record for which the preview image should be returned.
- $iWidth : int|null = null
-
Max width for preview. If null, original image width is used.
- $iHeight : int|null = null
-
Max height for preview. If null, original image height is used.
Tags
Return values
string —The image of the specified record relative to the admin folder..
getPreviewForRecordId()
Abstract method to get the preview image of the record specified by the id.
public
getPreviewForRecordId(int $iRecordId[, int|null $iWidth = null ][, int|null $iHeight = null ]) : string
Parameters
- $iRecordId : int
-
The record id of the record for which the preview image should be returned.
- $iWidth : int|null = null
-
Max width for preview. If null, original image width is used.
- $iHeight : int|null = null
-
Max height for preview. If null, original image height is used.
Tags
Return values
string —The image of the record specified by the id relative to the admin folder..
getRecordAttributeValues()
Fetches the values for the requested attributes of the item for the current data language of the item
public
getRecordAttributeValues(array<string|int, mixed> $aRecordIds, array<string|int, mixed> $aAttributeIds[, array<string|int, mixed> $aSortData = array() ][, mixed $mMedium = '' ], mixed $iLanguageId[, mixed $iType = CSITEM_VALUES_FORMATTED ]) : array<string|int, mixed>
Note: It internally uses CSItemApiItem::getValues(). Hence the attribute value would be absent from the resultset in case the requested attribute is not a part of the item classes OR if the attribute value is empty (not set).
Parameters
- $aRecordIds : array<string|int, mixed>
-
IDs of the records for which attribute values needs to be fetched
- $aAttributeIds : array<string|int, mixed>
-
IDs of the attributes for which the record values to be fetched
- $aSortData : array<string|int, mixed> = array()
-
Array containing sorting info to sort result set
- $mMedium : mixed = ''
-
the medium the values should be formatted for (e.g. CSItemMedium::TRANSLATIONMANAGER)
- $iLanguageId : mixed
- $iType : mixed = CSITEM_VALUES_FORMATTED
Tags
Return values
array<string|int, mixed> —The attribute values for the requested records in the format array( <RecordID1> => array ( <Attribute1> => <AttributeValue1>, <Attribute2> => <AttributeValue2>, ... <AttributeN> => <AttributeValueN>, ), ... <RecordIDM> => array ( <Attribute1> => <AttributeValue1>, <Attribute2> => <AttributeValue2>, ... <AttributeN> => <AttributeValueN>, ), );
getRecordForId()
Returns the record for the specified id.
public
final getRecordForId(int $iId) : Record
Parameters
- $iId : int
-
The id of the record to return.
Tags
Return values
Record —The record matching the current datasource record with the given id.
getRecordIdsForParentId()
Abstract method to get all record ids for a particular parent id.
public
getRecordIdsForParentId(mixed $iId[, mixed $bRecursive = false ]) : array<string|int, mixed>
Parameters
- $iId : mixed
- $bRecursive : mixed = false
-
Whether the children should be returned recursively or not.
Tags
Return values
array<string|int, mixed> —List of record ids with the specified parent id.
getRecordsForIds()
Abstract method to get all records for a list of ids.
public
getRecordsForIds(mixed $aIds) : array<string|int, mixed>
Parameters
- $aIds : mixed
-
The list of ids for which the records should be returned.
Tags
Return values
array<string|int, mixed> —List of records with the specified ids.
getRecordsForParentId()
Abstract method to get all records for a particular parent id.
public
getRecordsForParentId(mixed $iId[, mixed $bRecursive = false ]) : array<string|int, mixed>
Parameters
- $iId : mixed
- $bRecursive : mixed = false
-
Whether the children should be returned recursively or not.
Tags
Return values
array<string|int, mixed> —List of records with the specified parent id.
getSupportedSelectionTypesForRecord()
Returns all available selection types for the datasource.
public
final getSupportedSelectionTypesForRecord(mixed $oRecord) : array<string|int, mixed>
Parameters
- $oRecord : mixed
Tags
Return values
array<string|int, mixed> —List of supported selection types.
isRecordAFolder()
Abstract method to evaluate whether the specified record is a folder or not.
public
isRecordAFolder(mixed $oRecord) : bool
Parameters
- $oRecord : mixed
-
The record for which the folder flag should be checked.
Tags
Return values
bool —True, if the specified record is a folder, otherwise false.
isRecordDisabled()
Abstract method to evaluate whether the specified record is disabled.
public
isRecordDisabled(mixed $oRecord) : bool
Parameters
- $oRecord : mixed
-
The record which should be checked for disabled state.
Tags
Return values
bool —True, if the specified record disabled, otherwise false.
isValidDataString()
Checks whether the passed data string is valid for the current datasource.
public
final isValidDataString(string $sDataString) : bool
Parameters
- $sDataString : string
-
The data string to check.
Tags
Return values
bool —true, if the datasource considers the data string as valid, otherwise false.
mayViewRecord()
Abstract method to evaluate whether the specified record is visible in the current context.
public
mayViewRecord(mixed $oRecord) : bool
Parameters
- $oRecord : mixed
-
The record for which to check if it is visible.
Tags
Return values
bool —True, if the specified record is visible, otherwise false.
search()
Abstract method to execute a search on a datasource record.
public
search(mixed $sSearch[, mixed $mParentIds = array() ]) : array<string|int, mixed>
Parameters
- $sSearch : mixed
-
The search key.
- $mParentIds : mixed = array()
-
A parent id or array of ids that should be used as root for the search. If omitted, array() will be used.
Tags
Return values
array<string|int, mixed> —List of records matching the search criteria.
searchIds()
Abstract method to execute a search on a datasource record.
public
searchIds(mixed $sSearch[, mixed $mParentIds = array() ]) : array<string|int, mixed>
Parameters
- $sSearch : mixed
-
The search key.
- $mParentIds : mixed = array()
-
A parent id or array of ids that should be used as root for the search. If omitted, array() will be used.
Tags
Return values
array<string|int, mixed> —List of record ids matching the search criteria.
searchIdsWithFilter()
Searches all items matching a given search criteria
public
searchIdsWithFilter(string $sSearch, CSItemSearchFilter $oItemSearchFilter[, mixed $mParentIds = array() ][, array<string|int, mixed> $aSort = array() ][, bool $bRecursive = true ][, bool $bCheckInheritance = false ]) : CSItemSearchResult
Parameters
- $sSearch : string
-
the content which must be found. If it is set to '*' everything matching the other criteria (rootIDs, SqlFilter ...) is returned.
- $oItemSearchFilter : CSItemSearchFilter
-
The item search filter defining the filter criterias for the search query.
- $mParentIds : mixed = array()
- $aSort : array<string|int, mixed> = array()
-
the fields the result should be sorted by as an array with the field name as key and a CS_SORT constant as value (e.g. CS_SORT_STRING_ASC or CS_SORT_NUMERICAL_DESC)
- $bRecursive : bool = true
-
Whether to search recursively or only in the first child level of the given parent id
- $bCheckInheritance : bool = false
Tags
Return values
CSItemSearchResult —The search result
