CSObjectValuerangevalueDatasource
extends CSObjectRecordDatasource
in package
Represents a datasource interface for the object chooser.
Tags
Table of Contents
- 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.
- 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 of the attributes for the requested record IDs
- 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.
Constants
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) : array<string|int, mixed>
Parameters
- $oRecord : mixed
-
The record for which the data should be returned.
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.
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 creates an object of the record and uses self::getIconForRecord().
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 of the attributes for the requested record IDs
public
getRecordAttributeValues(array<string|int, mixed> $aRecordIds, array<string|int, mixed> $aAttributeIds, array<string|int, mixed> $aSortData, mixed $mMedium) : array<string|int, mixed>
All the records are processed in a loop to get the requested attribute valies from Data of the record
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 containing sorting info to sort result set
- $mMedium : mixed
-
the medium the values should be formatted for (e.g. CSItemMedium::TRANSLATIONMANAGER)
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.
