CSItem
in package
Tags
Table of Contents
- INHERITANCE_TYPE_CONTEXT = 3
- inheritance type context
- INHERITANCE_TYPE_LANGUAGE = 2
- inheritance type parent
- INHERITANCE_TYPE_PARENT = 1
- inheritance type parent
- addImage() : bool
- Registers an image or document to an attribute in a item.
- combineRecursiveArrays() : mixed
- createEditorDialog() : CSGuiEditorDialog
- Creates a new CSGuiItemEditorDialog
- createList() : CSGuiItemList
- Creates a new CSGuiItemList
- displayMasseditor() : mixed
- exportDocuments() : mixed
- Exports the documents of the given items to a local directory or to a ftp directory
- getAllowedConfigurationClassIds() : array<string|int, mixed>
- Returns the allowed configuration workflow ids for the current item.
- getAllowedConfigurationWorkflowIds() : array<string|int, mixed>
- Returns the allowed configuration workflow ids for the current item.
- getChildren() : array<string|int, mixed>
- Gets list of Item children
- getConfiguration() : Itemconfiguration
- Returns a configuration
- getConfigurationClassesGroupedByItemIds() : array<string|int, mixed>
- Returns an array (getValues like) of configurations (classes) for given Item Ids An internal cache helps to avoid calling CSItem::getValues multiple times for same ids.
- getConfigurationEditor() : mixed
- getConfigurationIDs() : array<string|int, mixed>
- Returns the configuration for given item ids.
- getConfigurationList() : string
- Returns forward url to Configuration List
- getConfigurationsForFieldIDs() : mixed
- getConfigurationsForItem() : Table
- Returns the configuration attributes of a given item
- getCrossReferencesForItem() : mixed
- Returns a table objects of collections which contains a given item
- getCSType() : CSType
- Returns the CSType of a given attribute
- getDefaultCSType() : string
- This CSType will be used, if no CSType is given
- getDocumentLink() : string
- Returns a HTML Link to an item document
- getFieldIDsForConfigurations() : array<string|int, mixed>
- Returns an array of Attribute Ids of given ConfigurationClass Ids.
- getImage() : string
- Returns an item image as a cs:image CSTag
- getItemEditor() : mixed
- getItemList() : mixed
- getKeywords() : array<string|int, mixed>
- Returns the keywords defined for the current item
- getMassEditor() : string
- Returns URL to the Mass Editor.
- getPathNodes() : array<string|int, mixed>
- Returns the path nodes as array
- getReferenceConfigurationLink() : Itemconfiguration
- Returns the configuration (a.k.a. class) associated with the references for an attribute of an item.
- getReferenceConfigurations() : array<string|int, mixed>
- Returns all fields of the configuration (a.k.a. class) associated with the references for an attribute of an item.
- getReferenceFormattedValue() : string
- Returns a specific additional value as formatted value that is associated with a specific reference for an attribute of an item.
- getReferenceFormattedValues() : array<string|int, mixed>
- Returns the additional values as formatted values that are associated with a specific reference for an attribute of an item.
- getReferences() : array<string|int, mixed>
- Returns the references for an attribute of a item.
- getReferencesByGroupedIds() : array<string|int, mixed>
- Returns the references for an attribute of a item as grouped array.
- getReferencesFormattedValues() : array<string|int, mixed>
- Returns the additional values as formatted values that are associated with the references for an attribute of an item.
- getReferencesValues() : array<string|int, mixed>
- Returns the additional values that are associated with the references for an attribute of an item.
- getReferenceValue() : string
- Returns a specific additional value that is associated with a specific reference for an attribute of an item.
- getReferenceValues() : array<string|int, mixed>
- Returns the additional values that are associated with a specific reference for an attribute of an item.
- getStructureEditor() : mixed
- getStructureList() : mixed
- getValues() : array<string|int, mixed>
- loads some values directly from the database and formats them using their cstypes, if the csTypeDetail parameter is set.
- getValuesForConfig() : array<string|int, mixed>
- Loads all values matching the getter definition.
- getValuesWithCURL() : mixed
- calls the getValues method within a CURL request to reduce memory consumption Supports the same parameters as CSItem::getValues. For details look at this method
- prepareConfigurationID() : int
- Returns the configurationID of an item, even if passed a label
- removeImage() : void
- Removes all image or document from an attribute in a item with a given url.
- searchContent() : array<string|int, mixed>
- Searches all items matching a given search criteria
- serializeItemToXml() : array<string|int, mixed>
- serializes an Item to XML
Constants
INHERITANCE_TYPE_CONTEXT
inheritance type context
public
mixed
INHERITANCE_TYPE_CONTEXT
= 3
Tags
INHERITANCE_TYPE_LANGUAGE
inheritance type parent
public
mixed
INHERITANCE_TYPE_LANGUAGE
= 2
Tags
INHERITANCE_TYPE_PARENT
inheritance type parent
public
mixed
INHERITANCE_TYPE_PARENT
= 1
Tags
Methods
addImage()
Registers an image or document to an attribute in a item.
public
static addImage(Item $item, int $attrID, string $url[, string $tooltip = '' ][, string $link = '' ][, array<string|int, mixed> $additionalParams = array() ]) : bool
If this should be persistent it is required that the $item->store() method is called afterwards.
Parameters
- $item : Item
- $attrID : int
-
the id of the attribute which contains the image
- $url : string
-
the path to the image
- $tooltip : string = ''
-
the tooltip of the image
- $link : string = ''
-
the link of the image
- $additionalParams : array<string|int, mixed> = array()
-
additional values in the form key=>value
Tags
Return values
bool —success indicator
combineRecursiveArrays()
public
static combineRecursiveArrays(mixed $array1, mixed $array2) : mixed
Parameters
- $array1 : mixed
- $array2 : mixed
Tags
Return values
mixed —createEditorDialog()
Creates a new CSGuiItemEditorDialog
public
static createEditorDialog(string|object $RecordName[, mixed $type = 1 ]) : CSGuiEditorDialog
Parameters
- $RecordName : string|object
-
the Item or the name of the record type the editor should be loaded from
- $type : mixed = 1
Tags
Return values
CSGuiEditorDialog —a new CSGuiEditorDialog
createList()
Creates a new CSGuiItemList
public
static createList(string|object $RecordName) : CSGuiItemList
Parameters
- $RecordName : string|object
-
the Item or the name of the item type the list should be loaded from
Tags
Return values
CSGuiItemList —a new CSGuiItemList
displayMasseditor()
public
static displayMasseditor(mixed $recordClass, mixed $ids) : mixed
Parameters
- $recordClass : mixed
- $ids : mixed
Tags
Return values
mixed —exportDocuments()
Exports the documents of the given items to a local directory or to a ftp directory
public
static exportDocuments(Item $item, string $target[, bool $depth = true ][, bool $allowInheritance = true ][, bool $addFolders = true ][, null $rootIds = null ][, null $languageId = null ][, array<string|int, mixed> $ftp = array() ][, null $exportSinceDate = null ][, bool $itemProcessFlushPoint = false ]) : mixed
Parameters
- $item : Item
-
The item instance for which the documents should be catched
- $target : string
-
The name of the directory
- $depth : bool = true
- $allowInheritance : bool = true
- $addFolders : bool = true
- $rootIds : null = null
- $languageId : null = null
- $ftp : array<string|int, mixed> = array()
-
An array with ftp setting, using following array keys: Host, User, Password, Port, PassiveMode
- $exportSinceDate : null = null
- $itemProcessFlushPoint : bool = false
Tags
Return values
mixed —getAllowedConfigurationClassIds()
Returns the allowed configuration workflow ids for the current item.
public
static getAllowedConfigurationClassIds(Item $oItem[, array<string|int, mixed> $aConfigurationClassIds = array() ]) : array<string|int, mixed>
Parameters
- $oItem : Item
-
The item for the configuration workflow ids.
- $aConfigurationClassIds : array<string|int, mixed> = array()
-
An array with configuration class ids.
Tags
Return values
array<string|int, mixed> —with the allowed configuration workflow ids.
getAllowedConfigurationWorkflowIds()
Returns the allowed configuration workflow ids for the current item.
public
static getAllowedConfigurationWorkflowIds(Item $oItem[, array<string|int, mixed> $aConfigurationClassIds = array() ]) : array<string|int, mixed>
Parameters
- $oItem : Item
-
The item for the configuration workflow ids.
- $aConfigurationClassIds : array<string|int, mixed> = array()
-
An array with configuration class ids for the allowed workflow ids.
Tags
Return values
array<string|int, mixed> —with the allowed configuration workflow ids.
getChildren()
Gets list of Item children
public
static getChildren(Item $item[, mixed $ParentID = null ][, int $depth = -1 ][, bool $includeItem = false ]) : array<string|int, mixed>
Parameters
- $item : Item
-
the item to get the children of
- $ParentID : mixed = null
-
the optional integer or array of integers describing the ParentIDs to get the children for
- $depth : int = -1
-
the depth of recursion (-1 to return all children)
- $includeItem : bool = false
-
whether the item with the given id should be included in the array
Tags
Return values
array<string|int, mixed> —with children of the article with the ID $ParentID
getConfiguration()
Returns a configuration
public
static getConfiguration(Item $item, int $id) : Itemconfiguration
Parameters
- $item : Item
- $id : int
-
the id of the configuration
Tags
Return values
Itemconfiguration —the record object of the matched configuration
getConfigurationClassesGroupedByItemIds()
Returns an array (getValues like) of configurations (classes) for given Item Ids An internal cache helps to avoid calling CSItem::getValues multiple times for same ids.
public
static getConfigurationClassesGroupedByItemIds(Item $item, array<string|int, mixed> $aItemIds) : array<string|int, mixed>
Parameters
- $item : Item
- $aItemIds : array<string|int, mixed>
Tags
Return values
array<string|int, mixed> —getConfigurationEditor()
public
static getConfigurationEditor([mixed $module = 'item' ][, mixed $class = 'Item' ][, mixed $isLink = null ]) : mixed
Parameters
- $module : mixed = 'item'
- $class : mixed = 'Item'
- $isLink : mixed = null
Tags
Return values
mixed —getConfigurationIDs()
Returns the configuration for given item ids.
public
static getConfigurationIDs(Item $oItem, array<string|int, mixed> $aIds) : array<string|int, mixed>
Parameters
- $oItem : Item
- $aIds : array<string|int, mixed>
Tags
Return values
array<string|int, mixed> —getConfigurationList()
Returns forward url to Configuration List
public
static getConfigurationList([string $module = 'item' ][, string $class = 'Item' ][, null|int $isLink = null ][, null|int $mIsFolder = null ][, null|int $iShowLinkAttributes = null ]) : string
Parameters
- $module : string = 'item'
-
A module name
- $class : string = 'Item'
-
A main Record Class name of the configuration
- $isLink : null|int = null
-
Tells if only IsLink values should be shown in the list
- $mIsFolder : null|int = null
-
Tells if only IsFolder values should be shown in the list (IsLink is also a Folder)
- $iShowLinkAttributes : null|int = null
-
Tells if only Class attributes should be shown in the list
Tags
Return values
string —getConfigurationsForFieldIDs()
public
static getConfigurationsForFieldIDs(mixed $item, mixed $fieldIDs) : mixed
Parameters
- $item : mixed
- $fieldIDs : mixed
Tags
Return values
mixed —getConfigurationsForItem()
Returns the configuration attributes of a given item
public
static getConfigurationsForItem(Item $item[, string $sqlFilter = '' ]) : Table
Parameters
- $item : Item
- $sqlFilter : string = ''
-
a SQL condition to filter the attributes
Tags
Return values
Table —the table object of the matched attributes
getCrossReferencesForItem()
Returns a table objects of collections which contains a given item
public
static getCrossReferencesForItem(Item $item[, bool $returnOnlyIds = false ]) : mixed
Parameters
- $item : Item
- $returnOnlyIds : bool = false
-
whether the table (true) or only all structure ids should be returned
Tags
Return values
mixed —either a Table or an array
getCSType()
Returns the CSType of a given attribute
public
static getCSType(Item $item, string $id) : CSType
Parameters
- $item : Item
- $id : string
-
the id of the attribute
Tags
Return values
CSType —the CStype object of the matched attribute
getDefaultCSType()
This CSType will be used, if no CSType is given
public
static getDefaultCSType() : string
Tags
Return values
string —Returns the default CSType
getDocumentLink()
Returns a HTML Link to an item document
public
static getDocumentLink(Item $item, int $attrID, mixed $text[, array<string|int, mixed> $params = array() ][, string $wrapHTML1 = '' ][, string $wrapHTML2 = '' ], int $filesizeprec[, mixed $decsperator = '.' ]) : string
Parameters
- $item : Item
- $attrID : int
-
the id of the attribute which contains the document
- $text : mixed
-
the label of the link
- $params : array<string|int, mixed> = array()
-
additional parameter for the Tag
- $wrapHTML1 : string = ''
-
HTML code which will be put before the Tag
- $wrapHTML2 : string = ''
-
HTML code which will be put after the Tag
- $filesizeprec : int
-
the number of decimals of the filesize
- $decsperator : mixed = '.'
Tags
Return values
string —getFieldIDsForConfigurations()
Returns an array of Attribute Ids of given ConfigurationClass Ids.
public
static getFieldIDsForConfigurations(Item $item, array<string|int, mixed> $configurationIDs) : array<string|int, mixed>
The Additive Inheritance of Classes is considered here.
Parameters
- $item : Item
- $configurationIDs : array<string|int, mixed>
Tags
Return values
array<string|int, mixed> —getImage()
Returns an item image as a cs:image CSTag
public
static getImage(Item $item, int $attrID[, array<string|int, mixed> $params = array() ][, string $wrapHTML1 = '' ][, string $wrapHTML2 = '' ]) : string
Parameters
- $item : Item
- $attrID : int
-
the id of the attribute which contains the image, or a json string containing the value
- $params : array<string|int, mixed> = array()
-
additional parameter for the cs:image CSTag
- $wrapHTML1 : string = ''
-
HTML code which will be put before the cs:image CSTag
- $wrapHTML2 : string = ''
-
HTML code which will be put after the cs:image CSTag
Tags
Return values
string —getItemEditor()
public
static getItemEditor([mixed $module = 'item' ][, mixed $class = 'Item' ][, mixed $title = 'Items' ][, mixed $id = null ]) : mixed
Parameters
- $module : mixed = 'item'
- $class : mixed = 'Item'
- $title : mixed = 'Items'
- $id : mixed = null
Tags
Return values
mixed —getItemList()
public
static getItemList([mixed $module = 'item' ][, mixed $class = 'Item' ][, mixed $title = 'Items' ][, mixed $noStructure = false ]) : mixed
Parameters
- $module : mixed = 'item'
- $class : mixed = 'Item'
- $title : mixed = 'Items'
- $noStructure : mixed = false
Tags
Return values
mixed —getKeywords()
Returns the keywords defined for the current item
public
static getKeywords(mixed $item) : array<string|int, mixed>
Parameters
- $item : mixed
Tags
Return values
array<string|int, mixed> —an array of all keywords as strings
getMassEditor()
Returns URL to the Mass Editor.
public
static getMassEditor(string $sRecordClass, array<string|int, mixed> $aIds) : string
Parameters
- $sRecordClass : string
-
The record class.
- $aIds : array<string|int, mixed>
-
The desired IDs as array which should be mass edited.
Tags
Return values
string —getPathNodes()
Returns the path nodes as array
public
static getPathNodes(Item $item) : array<string|int, mixed>
Parameters
- $item : Item
-
the item to get the path of
Tags
Return values
array<string|int, mixed> —the path nodes
getReferenceConfigurationLink()
Returns the configuration (a.k.a. class) associated with the references for an attribute of an item.
public
static getReferenceConfigurationLink(Item|CSItemApiItem $oItem, mixed $mRefSourceAttr[, mixed $bReturnAsArray = false ]) : Itemconfiguration
Parameters
- $oItem : Item|CSItemApiItem
-
The item containing the references to other items.
- $mRefSourceAttr : mixed
-
The name or ID of the attribute which contains the references. If an invalid or misleading ID or name is specified or the CSType does not inherit from the referenceCSType, a CSItemException is thrown.
- $bReturnAsArray : mixed = false
Tags
Return values
Itemconfiguration —The item configuration containing the attributes attached to the references stored in the attribute designated by $mRefSourceAttr. Returns an empty Itemconfiguration object if no configuration has been defined for the reference attribute.
getReferenceConfigurations()
Returns all fields of the configuration (a.k.a. class) associated with the references for an attribute of an item.
public
static getReferenceConfigurations(Item|CSItemApiItem $oItem, mixed $mRefSourceAttr[, bool $bIncludeContainerConfig = FALSE ]) : array<string|int, mixed>
Parameters
- $oItem : Item|CSItemApiItem
-
The item containing the references to other items.
- $mRefSourceAttr : mixed
-
The name or ID of the attribute which contains the references. If an invalid or misleading ID or name is specified or the CSType does not inherit from the referenceCSType, a CSItemException is thrown.
- $bIncludeContainerConfig : bool = FALSE
-
If set to TRUE, the configuration link containing all the fields (a.k.a. parent configuration) is included in the results.
Tags
Return values
array<string|int, mixed> —An array of item configurations. These are the attributes attached to the references stored in the attribute designated by $mRefSourceAttr. Returns an empty array if no configuration has been defined for the reference attribute.
getReferenceFormattedValue()
Returns a specific additional value as formatted value that is associated with a specific reference for an attribute of an item.
public
static getReferenceFormattedValue(Item $oItem, mixed $mRefSourceAttr, int $iRefTargetItemId, mixed $mRequestedAttrKey[, bool $bShowInherited = true ][, int $iLanguageId = null ]) : string
Parameters
- $oItem : Item
-
The item containing the references to other items.
- $mRefSourceAttr : mixed
-
The name or ID of the attribute which contains the references. If an invalid or misleading ID or name is specified or the CSType does not inherit from the referenceCSType, a CSItemException is thrown.
- $iRefTargetItemId : int
-
The ReferenceID of the referenced item that the value will be retrieved for.
- $mRequestedAttrKey : mixed
-
A string or int containing the ID/label of the attribute to retrieve from the reference.
- $bShowInherited : bool = true
-
Set to TRUE if inherited references should be added for additive inheritance.
- $iLanguageId : int = null
-
The language ID of the reference.
Tags
Return values
string —The requested reference attribute value. Returns NULL if the requested reference attribute does not exist.
getReferenceFormattedValues()
Returns the additional values as formatted values that are associated with a specific reference for an attribute of an item.
public
static getReferenceFormattedValues(Item|CSItemApiItem $oItem, mixed $mRefSourceAttr, int $iRefTargetItemId[, mixed $mRequestedAttrKeys = null ][, bool $bShowInherited = true ][, int $iLanguageId = null ]) : array<string|int, mixed>
Parameters
- $oItem : Item|CSItemApiItem
-
The item containing the references to other items.
- $mRefSourceAttr : mixed
-
The name or ID of the attribute which contains the references. If an invalid or misleading ID or name is specified or the CSType does not inherit from the referenceCSType, a CSItemException is thrown.
- $iRefTargetItemId : int
-
The ReferenceID of the referenced item that the values will be retrieved for.
- $mRequestedAttrKeys : mixed = null
-
A string, int or an array containing the ID(s)/label(s) of the attributes to retrieve from the references. If set to NULL, all available attributes will be retrieved.
- $bShowInherited : bool = true
-
Set to TRUE if inherited references should be added for additive inheritance.
- $iLanguageId : int = null
-
The language ID of the references.
Tags
Return values
array<string|int, mixed> —An array containing the reference attribute values, indexed by the original $mRequestedAttrKeys.
getReferences()
Returns the references for an attribute of a item.
public
static getReferences(Item|CSItemApiItem $item, int $attrID[, bool $showDetails = false ][, bool $showInherited = true ][, null $languageID = null ], mixed $iContextId) : array<string|int, mixed>
Parameters
- $item : Item|CSItemApiItem
-
The item containing the references.
- $attrID : int
-
The id of the attribute which contains the reference.
- $showDetails : bool = false
-
If this is set to true the result is returned as an array like: {'References' => { 'Reference' => $referenceObject, 'Multiplicity' => $multiplicity, 'Data' => $attributes, ...}, 'DeletedIDs' => $idList, 'InheritedIDs' => $idList } Otherwise only the $referenceObject is returned. If set to 'IDS' only the IDs are returned.
- $showInherited : bool = true
-
If inherited references should be added for additive inheritance
- $languageID : null = null
-
The language of the reference
- $iContextId : mixed
Tags
Return values
array<string|int, mixed> —An array of references either a second array or directly as objects
getReferencesByGroupedIds()
Returns the references for an attribute of a item as grouped array.
public
static getReferencesByGroupedIds(Item|CSItemApiItem $item, int $attrID[, bool $showInherited = true ][, null $languageID = null ], mixed $iContextId) : array<string|int, mixed>
Like: [ 'Pdmarticle' => [{ReferenceID} => {PdmarticleID}, {ReferenceID} => {PdmarticleID}, ...], '{RecordClassName}' => [{ReferenceID} => {MamfileID}, ...] ]
Parameters
- $item : Item|CSItemApiItem
-
The item containing the references.
- $attrID : int
-
The id of the attribute which contains the reference.
- $showInherited : bool = true
-
If inherited references should be added for additive inheritance
- $languageID : null = null
-
The language of the reference
- $iContextId : mixed
Tags
Return values
array<string|int, mixed> —An array of references
getReferencesFormattedValues()
Returns the additional values as formatted values that are associated with the references for an attribute of an item.
public
static getReferencesFormattedValues(Item $oItem, mixed $mRefSourceAttr[, mixed $mRequestedAttrKeys = null ][, bool $bShowInherited = true ][, int $iLanguageId = null ], mixed $iContextId) : array<string|int, mixed>
Parameters
- $oItem : Item
-
The item containing the references to other items.
- $mRefSourceAttr : mixed
-
The name or ID of the attribute which contains the references. If an invalid or misleading ID or name is specified or the CSType does not inherit from the referenceCSType, a CSItemException is thrown.
- $mRequestedAttrKeys : mixed = null
-
A string, int or an array containing the ID(s)/label(s) of the attributes to retrieve from the references. If set to NULL, all available attributes will be retrieved.
- $bShowInherited : bool = true
-
Set to TRUE if inherited references should be added for additive inheritance.
- $iLanguageId : int = null
-
The language ID of the references.
- $iContextId : mixed
Tags
Return values
array<string|int, mixed> —A two-dimensional array containing the reference attribute values. The first dimension designates the ReferenceIDs of the reference target item(s), the second dimension is indexed by the original $mRequestedAttrKeys and an additional column ID for the ID of the target.
getReferencesValues()
Returns the additional values that are associated with the references for an attribute of an item.
public
static getReferencesValues(Item|CSItemApiItem $oItem, mixed $mRefSourceAttr[, mixed $mRequestedAttrKeys = null ][, bool $bShowInherited = true ][, int $iLanguageId = null ], mixed $iContextId) : array<string|int, mixed>
Parameters
- $oItem : Item|CSItemApiItem
-
The item containing the references to other items.
- $mRefSourceAttr : mixed
-
The name or ID of the attribute which contains the references. If an invalid or misleading ID or name is specified or the CSType does not inherit from the referenceCSType, a CSItemException is thrown.
- $mRequestedAttrKeys : mixed = null
-
A string, int or an array containing the ID(s)/label(s) of the attributes to retrieve from the references. If set to NULL, all available attributes will be retrieved.
- $bShowInherited : bool = true
-
Set to TRUE if inherited references should be added for additive inheritance.
- $iLanguageId : int = null
-
The language ID of the references.
- $iContextId : mixed
Tags
Return values
array<string|int, mixed> —A two-dimensional array containing the reference attribute values. The first dimension designates the ReferenceIDs of the reference target item(s), the second dimension is indexed by the original $mRequestedAttrKeys and an additional column ID for the ID of the target.
getReferenceValue()
Returns a specific additional value that is associated with a specific reference for an attribute of an item.
public
static getReferenceValue(Item $oItem, mixed $mRefSourceAttr, int $iRefTargetItemId, mixed $mRequestedAttrKey[, bool $bShowInherited = true ][, int $iLanguageId = null ]) : string
Parameters
- $oItem : Item
-
The item containing the references to other items.
- $mRefSourceAttr : mixed
-
The name or ID of the attribute which contains the references. If an invalid or misleading ID or name is specified or the CSType does not inherit from the referenceCSType, a CSItemException is thrown.
- $iRefTargetItemId : int
-
The ReferenceID of the referenced item that the value will be retrieved for.
- $mRequestedAttrKey : mixed
-
A string or int containing the ID/label of the attribute to retrieve from the reference.
- $bShowInherited : bool = true
-
Set to TRUE if inherited references should be added for additive inheritance.
- $iLanguageId : int = null
-
The language ID of the reference.
Tags
Return values
string —The requested reference attribute value. Returns NULL if the requested reference attribute does not exist.
getReferenceValues()
Returns the additional values that are associated with a specific reference for an attribute of an item.
public
static getReferenceValues(Item|CSItemApiItem $oItem, mixed $mRefSourceAttr, int $iRefTargetItemId[, mixed $mRequestedAttrKeys = null ][, bool $bShowInherited = true ][, int $iLanguageId = null ], mixed $iContextId) : array<string|int, mixed>
Parameters
- $oItem : Item|CSItemApiItem
-
The item containing the references to other items.
- $mRefSourceAttr : mixed
-
The name or ID of the attribute which contains the references. If an invalid or misleading ID or name is specified or the CSType does not inherit from the referenceCSType, a CSItemException is thrown.
- $iRefTargetItemId : int
-
The ReferenceID of the referenced item that the values will be retrieved for.
- $mRequestedAttrKeys : mixed = null
-
A string, int or an array containing the ID(s)/label(s) of the attributes to retrieve from the references. If set to NULL, all available attributes will be retrieved.
- $bShowInherited : bool = true
-
Set to TRUE if inherited references should be added for additive inheritance.
- $iLanguageId : int = null
-
The language ID of the references.
- $iContextId : mixed
Tags
Return values
array<string|int, mixed> —An array containing the reference attribute values, indexed by the original $mRequestedAttrKeys.
getStructureEditor()
public
static getStructureEditor([mixed $module = 'item' ][, mixed $class = 'Item' ][, mixed $title = 'Items' ]) : mixed
Parameters
- $module : mixed = 'item'
- $class : mixed = 'Item'
- $title : mixed = 'Items'
Tags
Return values
mixed —getStructureList()
public
static getStructureList([mixed $module = 'item' ][, mixed $class = 'Item' ][, mixed $title = 'Items' ]) : mixed
Parameters
- $module : mixed = 'item'
- $class : mixed = 'Item'
- $title : mixed = 'Items'
Tags
Return values
mixed —getValues()
loads some values directly from the database and formats them using their cstypes, if the csTypeDetail parameter is set.
public
static getValues(Item $item[, array<string|int, mixed> $configurationIds = array() ][, mixed $depth = true ][, bool $allowInheritance = true ][, bool $addFolders = true ][, array<string|int, mixed> $rootIds = null ][, null|array<string|int, mixed>|int $languageId = null ][, int $csTypeDetail = CSITEM_VALUES_UNFORMATTED ][, array<string|int, mixed> $sortFields = array() ][, bool $groupByLanguageID = false ][, bool $checkRights = false ][, string $medium = '' ][, bool $returnSubTypes = true ][, array<string|int, mixed> $additionalOptions = array() ][, mixed $iContextId = null ]) : array<string|int, mixed>
Parameters
- $item : Item
-
the item instance for which the values should be catched
- $configurationIds : array<string|int, mixed> = array()
-
the IDs for the configurations. Its values might eitherbe integers describing configurationIDs or the strings 'Label', 'StateID', 'WorkflowID', 'ExternalKey' for the standard values. If this value is null then all fields are fetched
- $depth : mixed = true
-
the depth of searching children. Eighter an integer or true to get the values of all children
- $allowInheritance : bool = true
-
whether the result from the parent node should be returned if no value is found for an item
- $addFolders : bool = true
-
whether values from folders should also be returned
- $rootIds : array<string|int, mixed> = null
-
the rootIds which should be searched. If it is null the ID of the item is taken as rootId
- $languageId : null|array<string|int, mixed>|int = null
-
the languageId which should be searched
- $csTypeDetail : int = CSITEM_VALUES_UNFORMATTED
-
0 if no cstype should be applied, 1 if the formated value should be returned or 2 if detailed cstype informations should be returned in an array
- $sortFields : array<string|int, mixed> = array()
-
the fields the result should be sorted by, with the field name as key and a CS_SORT constant as value (e.g. CS_SORT_STRING_ASC or CS_SORT_NUMERICAL_DESC)
- $groupByLanguageID : bool = false
-
whether the result is a four dimensional array with itemId, configurationId, languageId and value.
- $checkRights : bool = false
-
whether the Itemrights should be checked
- $medium : string = ''
-
the medium the values should be formatted for (e.g. CSItemMedium::TRANSLATIONMANAGER)
- $returnSubTypes : bool = true
-
whether SubTypes should be returned
- $additionalOptions : array<string|int, mixed> = array()
-
further settings
- $iContextId : mixed = null
Tags
Return values
array<string|int, mixed> —a treedimensional array with as first key the itemId or itemId_subtype, if the subtype>=1 as second the configurationId and as value the inherited value
getValuesForConfig()
Loads all values matching the getter definition.
public
static getValuesForConfig(Item|CSItemApiItem $oItem, CSItemValuesGetter $oGetter) : array<string|int, mixed>
Parameters
- $oItem : Item|CSItemApiItem
-
The item instance for which values should be retrieved.
- $oGetter : CSItemValuesGetter
-
The definition of the getter to retrieve the values
Tags
Return values
array<string|int, mixed> —a threedimensional array with as first key the itemId or itemId_subtype, if the subtype>=1 as second the configurationId and as value the inherited value
getValuesWithCURL()
calls the getValues method within a CURL request to reduce memory consumption Supports the same parameters as CSItem::getValues. For details look at this method
public
static getValuesWithCURL(mixed $item[, mixed $configurationIds = array() ][, mixed $depth = true ][, mixed $allowInheritance = true ][, mixed $addFolders = true ][, mixed $rootIds = null ][, mixed $languageId = null ][, mixed $csTypeDetail = CSITEM_VALUES_FORMATTED ][, mixed $sortFields = array() ][, mixed $groupByLanguageID = false ][, mixed $checkRights = false ][, mixed $medium = '' ][, mixed $returnSubTypes = true ][, mixed $additionalOptions = array() ][, mixed $iContextId = null ]) : mixed
Parameters
- $item : mixed
- $configurationIds : mixed = array()
- $depth : mixed = true
- $allowInheritance : mixed = true
- $addFolders : mixed = true
- $rootIds : mixed = null
- $languageId : mixed = null
- $csTypeDetail : mixed = CSITEM_VALUES_FORMATTED
- $sortFields : mixed = array()
- $groupByLanguageID : mixed = false
- $checkRights : mixed = false
- $medium : mixed = ''
- $returnSubTypes : mixed = true
- $additionalOptions : mixed = array()
- $iContextId : mixed = null
Tags
Return values
mixed —prepareConfigurationID()
Returns the configurationID of an item, even if passed a label
public
static prepareConfigurationID(Item $item, mixed $confID) : int
Parameters
- $item : Item
-
the current item
- $confID : mixed
-
either a configurationID or a label
Tags
Return values
int —$confID the configurationID of the field
removeImage()
Removes all image or document from an attribute in a item with a given url.
public
static removeImage(Item $item, int $attrID[, string $url = null ]) : void
If this should be persistent it is required that the $item->store() method is called afterwards.
Parameters
- $item : Item
- $attrID : int
-
the id of the attribute which contains the image
- $url : string = null
-
the path to the image or null if all images should be removed
Tags
Return values
void —searchContent()
Searches all items matching a given search criteria
public
static searchContent(Item $item, string $find[, mixed $attrIDs = null ], mixed $rootIDs[, mixed $depth = true ][, bool $checkInheritage = true ][, int $searchMode = CS_SEARCH_WITH_AND ], int $cacheTime[, array<string|int, mixed> $sortFields = array() ][, string $limit = '' ][, string $sqlFilter = '' ]) : array<string|int, mixed>
Parameters
- $item : Item
-
an instance of the item object which should be searched
- $find : string
-
the content which must be found. If it is set to '*' everything matching the other criterias (rootIDs, SqlFilter ...) is returned
- $attrIDs : mixed = null
-
either null to search all fields or an array containing direct values of the item like 'ExternalKey', the value 'Label' or FieldIDs. The value 'Keywords' is also allowed searching the keywords. This attribute limits the fields which should be searched.
- $rootIDs : mixed
-
either an integer or an array of integers describing the folders which should be searched
- $depth : mixed = true
-
the depth of searching children. Eighter an integer or true to get the values of all children
- $checkInheritage : bool = true
-
Whether inherited fields should be included into the search result or not. IMPORTANT: This parameter only has effect when not using any kind of search index. In case any search index is used and the search is not executed on the MySQL database, this parameter is ignored, as the information about inheritance is not available.
- $searchMode : int = CS_SEARCH_WITH_AND
-
a CS_SEARCH_ constant (CS_SEARCH_WITH_AND, CS_SEARCH_WITH_OR, CS_SEARCH_EXACT_PHRASE)
- $cacheTime : int
-
the time in minutes a search result may be cached
- $sortFields : array<string|int, mixed> = array()
-
the fields the result should be sorted by, with the field name as key and a CS_SORT constant as value (e.g. CS_SORT_STRING_ASC or CS_SORT_NUMERICAL_DESC)
- $limit : string = ''
-
SQL limit condition in the form [Amount] or [Start],[Amount] as integers where [Start] is beginning with the index 0.
- $sqlFilter : string = ''
-
an additional sqlfilter which should be applied to the database queries, where all fields must have the alias item, e.g. 'item.IsFolder=1' or 'item.CheckoutUser=0'
Tags
Return values
array<string|int, mixed> —an array of itemIDs matching the search with the given criteria.
serializeItemToXml()
serializes an Item to XML
public
static serializeItemToXml(Item $item[, int $depth = 1 ], int $referenceDepth[, array<string|int, mixed> $languageIDs = null ][, mixed $serializeConfigurations = null ][, string $dstFile = "" ][, string $xslFile = "" ][, mixed $additionalOptions = array() ]) : array<string|int, mixed>
Parameters
- $item : Item
-
the item to serialize
- $depth : int = 1
-
the depth of the XML structure or -1 if all child nodes should be added
- $referenceDepth : int
-
the depth of the XML structure or -1 if all referenced child nodes should be added
- $languageIDs : array<string|int, mixed> = null
-
an array of languageIDs which should be visible or null for the current language
- $serializeConfigurations : mixed = null
-
eithernull to serialize all configurations or an arrayof configurationIDs
- $dstFile : string = ""
-
the file to which the XML should be written
- $xslFile : string = ""
-
the xsl stylesheet which should be automatically applied to the XML
- $additionalOptions : mixed = array()
Tags
Return values
array<string|int, mixed> —$additionalOptions additional settings which may be passed to the CSItemExport, containing special keys like:
- 'useCDATA': whether CDATA (true) elements or escaped entities should be used
