Contentserv PHP API

CSObjectDatasource
in package

Represents a datasource interface for the object chooser.

Tags
since

CS16.0

Table of Contents

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.

Methods

getDataForRecord()

Abstract method to get the data of the specified record.

public abstract getDataForRecord(Record $oRecord) : array<string|int, mixed>
Parameters
$oRecord : Record

The record for which the data should be returned.

Tags
access

public

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
access

public

Return values
CSObjectDatasource

The datasource object for the given record.

getIconForRecord()

Abstract method to get the icon of the specified record.

public abstract getIconForRecord(Record $oRecord) : string
Parameters
$oRecord : Record

The record for which the icon should be returned.

Tags
access

public

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 abstract 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 abstract getLabelForRecord(Record $oRecord) : string
Parameters
$oRecord : Record

The record for which the label should be returned.

Tags
access

public

Return values
string

The label of the specified record.

getLabelPathForRecord()

Abstract method to get the label path for the specified record.

public abstract getLabelPathForRecord(Record $oRecord) : array<string|int, mixed>
Parameters
$oRecord : Record

The record for which the label path should be returned.

Tags
access

public

Return values
array<string|int, mixed>

The label path.

getPreviewForRecord()

Abstract method to get the preview image of the specified record.

public abstract 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
access

public

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 abstract 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
access

public

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 abstract getRecordAttributeValues(array<string|int, mixed> $aRecordIds, array<string|int, mixed> $aAttributeIds, array<string|int, mixed> $aSortData, mixed $mMedium) : array<string|int, mixed>
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
access

public

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 abstract getRecordIdsForParentId(mixed $iId[, bool $bRecursive = false ]) : array<string|int, mixed>
Parameters
$iId : mixed
$bRecursive : bool = false

Whether the children should be returned recursively or not.

Tags
access

public

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 abstract getRecordsForIds(array<string|int, mixed> $aIds) : array<string|int, mixed>

Important: It is expected that this method returns an associative array that contains the record id as key and the record object as value!

Parameters
$aIds : array<string|int, mixed>

The list of ids for which the records should be returned.

Tags
access

public

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 abstract getRecordsForParentId(mixed $iId[, bool $bRecursive = false ]) : array<string|int, mixed>
Parameters
$iId : mixed
$bRecursive : bool = false

Whether the children should be returned recursively or not.

Tags
access

public

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
access

public

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 abstract isRecordAFolder(Record $oRecord) : bool
Parameters
$oRecord : Record

The record for which the folder flag should be checked.

Tags
access

public

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 abstract isRecordDisabled(Record $oRecord) : bool
Parameters
$oRecord : Record

The record which should be checked for disabled state.

Tags
access

public

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
access

public

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 abstract mayViewRecord(Record $oRecord) : bool
Parameters
$oRecord : Record

The record for which to check if it is visible.

Tags
access

public

Return values
bool

True, if the specified record is visible, otherwise false.

Abstract method to execute a search on a datasource record.

public abstract search(string $sSearch[, mixed $mParentIds = array() ]) : array<string|int, mixed>
Parameters
$sSearch : string

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
access

public

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 abstract searchIds(string $sSearch[, mixed $mParentIds = array() ]) : array<string|int, mixed>
Parameters
$sSearch : string

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
access

public

Return values
array<string|int, mixed>

List of record ids matching the search criteria.


        

Search results