Contentserv PHP API

CSObjectMamfileDatasource extends CSObjectItemDatasource
in package

Represents a datasource interface for the object chooser.

Tags
since

CS18.0

Table of Contents

ATTRIBUTE_EXTERNALKEY  = 'ExternalKey'
ATTRIBUTE_FILENAME  = 'FileName'
ATTRIBUTE_FILETYPE  = 'FileType'
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>
If one of the parent volumes is supporting manual sorting the sort order list will contain the "SortOrder" property as first sort entry.
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

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
access

public

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
throws
CSException

In the following cases:

  1. Inadequate access rights for copy operation
  2. Invalid source record is provided
  3. Invalid target record is provided
  4. The record was not copied due to any other reason
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
throws
CSException

In the following cases:

  1. Inadequate access rights for delete operation
  2. ID of the record is zero
  3. The record was not deleted due to any other reason
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
access

public

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
access

public

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[, bool $bExtended = false ][, int $iLanguageId = null ][, int $iContextId = null ]) : array<string|int, mixed>
Parameters
$oRecord : mixed

The record for which the data should be returned.

$bExtended : bool = false

When set to true, the entire detailed information of the record is retrieved, including formatted, unformatted values as well as inheritance information.

$iLanguageId : int = null

Optional parameter that enables the method to retrieve the item information in another language other than the current one.

$iContextId : int = null

Optional parameter that enables the method to retrieve the item information in a specific context.

Tags
inheritdoc
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.

getDefaultListAttributes()

Returns the attributes for which data needs to displayed in studio list

public getDefaultListAttributes() : array<string|int, mixed>
Tags
inheritdoc
Return values
array<string|int, mixed>

getDefaultSortOrderForParentIds()

If one of the parent volumes is supporting manual sorting the sort order list will contain the "SortOrder" property as first sort entry.

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

The record for which the folder flag should be checked.

Tags
inheritdoc
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
inheritdoc
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 mayViewRecord(mixed $oRecord) : bool
Parameters
$oRecord : mixed

The record for which to check if it is visible.

Tags
inheritdoc
Return values
bool

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

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

public

Return values
CSItemSearchResult

The search result


        

Search results