CSMamFile
extends CSItemApiItem
in package
implements
CSMetaDataInterface
Defines API method of Items in the Item Model
Tags
Interfaces, Classes and Traits
- CSMetaDataInterface
Table of Contents
- __call() : mixed
- Call functions that are not defined in this class, but in the MamFile.
- __destruct() : mixed
- addActionHistory() : void
- Add an action to the items history information. History entries have at least to be defined by an action name and an action description (max. 255 letters).
- addConfigurationClassIds() : mixed
- Adds / Extends the configuration class ids to the current item.
- addImage() : bool
- Registers an image or document to a given attribute in the product.
- addPreviewMaster() : void
- Add a web-based image file as a master preview file which will be used for the creation of all preview files used in CONTENTSERV
- addReference() : CSItemApiReference|null
- Adds one or more references for an attribute
- archive() : bool
- Returns whether the file is archived
- checkin() : bool
- Checks the item in
- checkout() : bool
- Checks the item out
- compareFormattedValueTo() : mixed
- Compares the formatted content whether it is marked as changed to an old value
- copy() : CSItemApiItem
- Copies an existing item
- createLink() : CSMamFile
- Creates a link to the MamFile in a given directory
- delete() : void
- Deletes an item
- deleteKeyword() : mixed
- Deletes a keyword from the current item
- deleteKeywords() : mixed
- Deletes all keywords for the current item
- deletePreviewFiles() : void
- Deletes the cache files for the CSMamFile and its children and marks the previews as missing
- disableRightCheck() : bool
- This method can be used to disable the standard right checks for this object.
- enableRightCheck() : bool
- This method can be used to enable the standard right checks for this object.
- executeWorkflowAction() : bool
- executes a workflow action on the current record
- exists() : bool
- Is the current file instance existing.
- exportExcel() : string
- Exports the Items to a Excel file (like in the Excel list export)
- getAccessLevels() : array<string|int, mixed>
- Returns an array containing all accesslevels for this item
- getActionHistory() : CSItemApiHistory
- Retrieve item action history api
- getAggregatedValue() : float
- Aggregates the values for a given field
- getAllFields() : array<string|int, CSItemApiField>
- Return all known fields including the default api fields objects (like for Label, ExternalKey, ..) and the user defined fields (including system api fields with negative ID)
- getAttachmentFolder() : string
- Returns the MAM path where attachments are stored
- getAvailableWorkflowActions() : array<string|int, Action>
- Returns the available Workflow Actions for the current item
- getBackReferences() : array<string|int, mixed>
- Returns all backreferences for an item
- getChangedAt() : string
- Return last change date of the item
- getChildren() : array<string|int, CSItemApiItem>
- Returns an array with the children of an item
- getChildrenIDs() : array<string|int, mixed>
- Returns an array with the ids of the children of an item
- getConfigurationClassId() : int
- Returns the root configuration class of the item
- getConfigurationClassIds() : array<string|int, mixed>
- Returns the configuration class ids of the item.
- getConfigurationField() : CSItemApiField
- Returns the CSItemApiField object for the current items configuration (Base Field)
- getContextFolder() : string
- Returns the mam path of a context folder (object folder) for the current item (@see CSMam::getContextFolder())
- getCreatedAt() : string
- Return creation date of the item
- getCrossReferencedViews() : array<string|int, mixed>
- Returns all CSItemApiViews referencing this item
- getCSImage() : string
- Returns a item image as a cs:image CSTag
- getCTime() : string
- Return the creation date for the current file.
- getDataCTime() : string
- Return creation date of CONTENTSERV data entry for current file
- getDataMTime() : string
- Return modification date of CONTENTSERV data entry for current file
- getDefaultLanguageID() : int
- Returns the ID of the default language from the current session.
- getDocumentLanguage() : object
- returns the document language for the current document
- getDocumentLanguageID() : int
- returns the document language id for the current document
- getDocumentLink() : string
- Returns a HTML Link to a document of the product
- getDownloadLink() : string
- Returns the URL of the link, where the user can download the file.
- getDriverFile() : CSMamDriverFile
- Returns the MAM driver file API object of the file.
- getDuplicatesByMD5() : array<string|int, mixed>
- Returns the duplicate files with the same MD5 hash of the current file.
- getEditorURL() : string
- Returns the URL to the backend editor for this Item
- getEXIF() : mixed
- Retrieve EXIF informations for this file
- getExternalKey() : string
- Returns the external key of the item
- getField() : CSItemApiField
- Returns a specific field of an item
- getFieldByIdentifier() : CSItemApiField
- getFieldIDs() : array<string|int, mixed>
- Returns all the FieldsID of the item without the base field
- getFields() : array<string|int, CSItemApiField>
- Returns all the fields of the item without the base field
- getFieldStateID() : int
- Gets the Workflow State for a given field
- getFileBaseName() : string
- Obtain filename without the file suffix
- getFileContent() : string
- Returns the file content of the MamFile.
- getFileName() : string
- Obtain the FileName without directories
- getFilePath() : string
- Returns the Path of the file
- getFiles() : array<string|int, CSMamFile>
- Obtain list of CSMamFile objects contained in current folder
- getFileSize() : string
- Retrieve formatted file size information. Returns "0" for folders.
- getFileType() : string
- Obtain file type suffix, e.g. "jpg"
- getFolder() : CSMamFile
- Returns the folder of the CSMamFile
- getFormattedValue() : mixed
- Gets a formatted value of an item.
- getFormattedValues() : array<string|int, mixed>
- Loads some values directly from the database and formats them automatically.
- getGrid() : CSGrid
- Returns an value from an appropriate field as CSGrid object
- getIcon() : string
- Retrieve image URL of an icon representing the current file
- getID() : int
- Returns the ID of the item
- getImage() : string
- Returns the path of the image in the ImageServer.
- getImageColorspace() : string
- Returns the colorspace of the file, if it is an image.
- getImageFile() : CSFileStream|null
- Returns the file stream of the image in the ImageServer.
- getImageHeight() : int
- Returns the height of the file in pixel, if it is an image.
- getImageResolution() : int
- Returns the resolution of the file in dpi, if it is an image.
- getImageServerID() : string
- Returns the ID which must be passed to the ImageServer URL
- getImageServerURL() : string
- Returns the URL of the ImageServer, which displays this item (or preview image of this item).
- getImageServerURLForPreset() : string
- Returns the URL of the ImageServer, which displays this file, based on the passed preset.
- getImageWidth() : int
- Returns the width of the file in pixel, if it is an image.
- getIPTC() : mixed
- Retrieve IPTC informations for this file
- getItem() : Item
- Returns the Item Record which corresponds to the CSItemApiItem object
- getItemOwner() : int
- Returns the UserID of the owner of the item
- getKeywords() : array<string|int, mixed>
- Returns the keywords defined for the current file
- getLabel() : string
- Returns the label of the item
- getLabelPath() : array<string|int, string>
- Returns an array with the labels of an item.
- getLinkedFile() : CSMamFile
- Returns the file a MamFile is linked to
- getLocalFilesystemPath() : string
- Returns the path of the file in the local filesystem where the file can be read from or should be written to If the path for reading is requested and the original file is not accessible through the local filesystem a copy is downloaded and its path is returned
- getLockUser() : CSUser
- returns the user object for the user id the file has been locked for
- getMamPath() : string
- Returns the MamPath of the file
- getMasterDimensions() : array<string|int, mixed>
- Returns the pixel dimensions of the master image of a given MAM image file.
- getMasterPreviewCacheFile() : CSMamVolumeCacheFile
- Returns the master preview cache file to create / embed previews from / in webpages or other applications.
- getMasterPreviewPath() : string
- Returns the path of the master preview in the local filesystem, to create / embed previews from / in webpages or other applications.
- getMetaData() : CSFileMetadata
- Returns object of CSFileMetadata.
- getMetaDataClass() : CSFileMetaData
- Returns the metadata class for the MamFile class.
- getMetaDataTypes() : array<string|int, mixed>
- Returns the supported meta types for the current class.
- getMTime() : string
- Return the date of last change on the current file.
- getNewInstance() : CSItemApiItem
- Returns a new instance of the current object for a new ID
- getOwner() : int
- Returns the UserID of the owner of the item, if it is checked out.
- getParent() : CSItemApiItem
- Returns the parent of an CSItemApiItem
- getPath() : array<string|int, mixed>
- Returns an array with the ancestors of an item
- getPredecessor() : CSItemApiItem
- Returns the Predecessor of an CSItemApiItem
- getPreviewFields() : array<string|int, CSItemApiField>
- Returns fields that were marked as preview fields
- getPreviewImage() : string
- Returns the path of the preview image in the ImageServer.
- getPreviewImageURL() : string
- Returns the path of the preview image in the ImageServer.
- getRating() : object
- Retrieve item rating api
- 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.
- getReferencedItem() : CSItemApiItem
- Returns the first referenced item for a reference CSType Attribute
- getReferenceList() : CSItemApiReferenceList
- Returns the reference list for an attribute of the item
- getReferences() : array<string|int, mixed>
- Returns the references for an attribute of the item It is recommended to use CSItemApiReferenceList API instead of this method. (getReferenceList method)
- 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.
- getRoles() : array<string|int, mixed>
- Returns all roles the current user has for this item
- getSimpleSearchableFieldIds() : array<string|int, mixed>
- Fetches the list of simple searchable field IDs
- getStandardFields() : array<string|int, CSItemApiField>
- Returns all the standard fields of the item and their API representation Note: As the CSItemFields are just wrappers not to be designed to display standard fields not all available methods will work for them
- getTable() : CSItemApiTable
- Gets a TableAPI-Object for a given Field ID
- getTableRow() : CSItemApiTableRow
- Returns the CSItemApiTableRow object for a given TableRowID
- getUploadLink() : string
- Returns the html code for a link where one can upload a new file to the current file.
- getValue() : mixed
- Gets a value of an item
- getValueAsImageURL() : mixed
- Returns the URL of the ImageServer, which displays this file.
- getValueForConfig() : mixed
- Queries the value defined by the getter object
- getValues() : array<string|int, mixed>
- Loads some values directly from the database and do not format them automatically.
- getValuesForConfig() : array<string|int, mixed>
- Loads all values matching the getter definition.
- getVolume() : CSMamVolume
- Returns the CSMamVolume of the CSMamFile
- getWebDavJSCode() : string
- generates javascript code to open the current file in a webdav client
- getWrapperItem() : CSItemApiWrapperItem
- Returns the cluster item of the current item API item.
- getXMP() : mixed
- Retrieve XMP headers for this file
- hasPreviewMaster() : bool
- Check for a preview master file
- hasVersionFile() : mixed
- importExcel() : string
- Imports on Excel or CSV file in the format of the {@link CSItemApiItem::exportExcel} format.
- isArchived() : bool
- Returns whether the file is archived
- isCheckedOut() : bool
- Check if the current item is checked out by the current user
- isEditable() : bool
- Chechs whether the current user has the right to edit the item
- isFolder() : bool
- Check if the file instance is a folder.
- isForeignCheckedOut() : bool
- Check if the current item is checked out by a user who is not the current user (a/k/a "foreign check-out")
- isImage() : bool
- Returns true if the file is an image
- isLink() : bool
- Returns true if the file is a link
- isLocked() : bool
- returns whether the current file is locked
- isLockedForOtherUser() : bool
- returns whether the current file is locked by another user as the current user
- isMetaDataLicenseActivated() : mixed
- Returns a boolean value whether the license for meta data is activated or not.
- isMetaDataSupportActivated() : bool
- Returns a boolean whether the meta data support is activated or not.
- isPrintfile() : bool
- Defines if file is valid printfile
- isRegistered() : bool
- Check if the current file instance is contained in a CSMamVolume of the MAM-Suite
- isVideo() : bool
- Returns true if the file is a video
- isViewable() : bool
- Checks whether the current user has the right to view the item
- isWritable() : bool
- Check for writing access on the current file instance. Not necessarily based on physical write ability of current user
- loadVersion() : void
- Loads a specific version with a given versionNr of the current item
- lock() : int
- locks a file to prevent file system perations by another users
- move() : bool
- Moves the item near to the target item
- removeImage() : void
- Removes all image or document from an attribute in the product with a given url.
- removeReference() : bool
- Removes the references for an attribute
- restore() : bool
- Returns whether the file is archived
- restoreFromPreviewMaster() : bool
- Restore the live master from the uploaded preview master This will not start the sync
- searchContent() : CSItemSearchResult|array<string|int, int>
- Searches all items matching a given search criteria
- searchContentExtended() : CSItemSearchResult
- This method handles searchSimpleContent method result paginated way.
- searchSimpleContent() : CSItemSearchResult|array<string|int, int>
- Searches all items matching a given search criteria
- setAccessLevels() : void
- Sets the access levels for this item
- setConfiguration() : void
- Sets the configuration id for the current item
- setConfigurationClassIds() : void
- Sets the configuration class ids
- setDefaultLanguageID() : mixed
- Changes the default language to the given language for the current session and therefore for all items.
- setExternalKey() : void
- Sets the external key of the item
- setFieldStateID() : int
- Sets the Workflow State for a given field
- setFileContent() : bool
- Sets a new file content to the MamFile.
- setFileName() : mixed
- Renames the CSMamFile
- setFormattedValue() : void
- Sets a formatted value of an item
- setGrid() : void
- Allows to set a CSGridItem as value to a field
- setKeyword() : mixed
- Adds a keyword to the current item
- setKeywords() : mixed
- Sets the keywords for the current item
- setLabel() : void
- Sets the label of the item
- setOmittingVersionFile() : bool
- this method allows it to temporary disable the version file creation.
- setReferences() : void
- Sets the references for an attribute
- setReferencesValues() : bool
- Associates multiple additional values with the references for an attribute of an item.
- setReferenceValue() : bool
- Associates a single value with a specific reference for an attribute of an item.
- setReferenceValues() : bool
- Associates multiple additional values with a specific reference for an attribute of an item.
- setValue() : void
- Sets a value of an item
- setValueForConfig() : void
- Sets a value on the item matching the setter definition.
- setValues() : bool
- This method is designed to update multiple values for multiple Items.
- setValuesForConfig() : void
- Sets values on the item matching the setter definition.
- store() : int
- Stores an item to the database and returns the ID of the item
- synchronize() : array<string|int, mixed>
- Synchronizes all files within the current folder Sometimes a extended synchronisation is required, e.g. when the local version files have been deleted, e.g. by installing a backup on a other system. For this reason the $forceCompleteCheck flag has been added.
- toXml() : array<string|int, mixed>
- Returns an xml content with the item and it's children
- undoCheckout() : bool
- Do an undo checkout to the current item
- unlink() : bool
- Replaces a link with a copy of the original file
- unlock() : int
- unlocks a file previously locked by the lock-method
- unzip() : array<string|int, CSMamFile>
- Extracts files from the Mamfile, if it is a zip.
- unzipFiles() : array<string|int, CSMamFile>
- Extracts only files (without folder structure) from the MamFile, if it is a zip.
Methods
__call()
Call functions that are not defined in this class, but in the MamFile.
public
__call(string $name, array<string|int, mixed> $params) : mixed
Parameters
- $name : string
-
Name of the function called, e.g. 'clearCache'
- $params : array<string|int, mixed>
-
Parameters that have been supplied to the function call
Tags
Return values
mixed —false if function doesn't exist in driver or else the return value of the function from the driver implementation
__destruct()
public
__destruct() : mixed
Tags
Return values
mixed —addActionHistory()
Add an action to the items history information. History entries have at least to be defined by an action name and an action description (max. 255 letters).
public
addActionHistory(string $action, mixed $short[, mixed $long = '' ][, string $objType = '' ], int $objID[, string $stateBefore = '' ][, string $stateAfter = '' ]) : void
Additionally, and to allow for versioning subelements of items, an object type and an object identifier can be given. E.g. if the item is an indesign document, it might contain sublementary text containers that can be versionized by setting the object type to the container class and by specifying the id of the instance of this class.
To save the states of an item by change and not by checkin, the $stateBefore and $stateAfter attributes can be included in the call of this function. It is possible to supply an XML snippet that describes the state an item had before the operation and after. These may not be binaries of any form. File changes can be versionized by giving file paths to the historic and the changed file version.
Parameters
- $action : string
-
a short text that stands for the type of action that describes the action type, e.g. "checkout" or "rename"
- $short : mixed
- $long : mixed = ''
- $objType : string = ''
-
name of a sublementary item object, e.g. "page" or "exif"
- $objID : int
-
identification number of the items sub-object
- $stateBefore : string = ''
-
reference or xml snippet to allow for recreation of the state before an action took place
- $stateAfter : string = ''
-
reference or xml snippet that allows to recreate an item state after an action took place
Tags
Return values
void —addConfigurationClassIds()
Adds / Extends the configuration class ids to the current item.
public
addConfigurationClassIds(array<string|int, mixed> $aClassIds) : mixed
Parameters
- $aClassIds : array<string|int, mixed>
-
An array with configuration class or folder ids.
Tags
Return values
mixed —addImage()
Registers an image or document to a given attribute in the product.
public
addImage(int $attrID, string $url[, string $tooltip = null ][, string $link = null ][, bool $doStore = false ][, array<string|int, mixed> $additionalParams = array() ]) : bool
Parameters
- $attrID : int
-
the id of the attribute which contains the image
- $url : string
-
the path to the image either as path or as MamfileID
- $tooltip : string = null
-
the tooltip of the image
- $link : string = null
-
the link of the image
- $doStore : bool = false
-
store the product for a persistent change
- $additionalParams : array<string|int, mixed> = array()
-
additional values in the form key=>value which might be the standard keys like 'Type' or userdefined values
Tags
Return values
bool —success indicator
addPreviewMaster()
Add a web-based image file as a master preview file which will be used for the creation of all preview files used in CONTENTSERV
public
addPreviewMaster(string $filePath[, bool $delExisting = true ][, bool $startCreation = true ]) : void
The preview file given should have the same width and height as the original file. A default preview master is usually the same size or at least 1024 Pixels wide and 768 Pixels high.
The preview fiel is copied to the thumbs folder as the master as well as to the asset folder where it is retrieved from when image previews are deleted
The replacement is available as soon this method finishes processing. Therefore, all existing preview files are removed and the creation of the previews is started while using the new preview file.
Parameters
- $filePath : string
-
location of temporary preview file
- $delExisting : bool = true
-
default: true, false if existing previews should not be removed
- $startCreation : bool = true
-
default: true, false if thumbs should be deleted but creation should not be started
Tags
Return values
void —addReference()
Adds one or more references for an attribute
public
addReference(int $iAttrID[, int|Record|array<string|int, int>|array<string|int, Record> $amRefIDs = array() ][, int $iLanguageID = null ][, array<string|int, mixed> $aAdditionalParams = array() ][, bool $bInsertAtEnd = true ][, string $sClassName = null ], mixed $iContextId) : CSItemApiReference|null
Parameters
- $iAttrID : int
-
The id of the attribute which contains the references
- $amRefIDs : int|Record|array<string|int, int>|array<string|int, Record> = array()
-
Eighter a single id|Record or an array containing the ids|Records of the new references
- $iLanguageID : int = null
-
The optional languageID
- $aAdditionalParams : array<string|int, mixed> = array()
-
additional values in the form key=>value which might be the keys like 'Type', 'SortOrder' or user defined values
- $bInsertAtEnd : bool = true
-
Whether the reference should be added after (true) or before (false) all others.
- $sClassName : string = null
-
The class name for the Records to be added. $refIDs is only containing ids this param will be used to add the correct record. If no class name is given the first configured record from CSType will be used by default
- $iContextId : mixed
Tags
Return values
CSItemApiReference|null —The created reference or null if something went wrong or no ids are given
archive()
Returns whether the file is archived
public
archive(mixed $archiveVolumeID) : bool
Parameters
- $archiveVolumeID : mixed
Tags
Return values
bool —whether the file is archived
checkin()
Checks the item in
public
checkin([bool $recursive = false ][, string $note = null ]) : bool
Parameters
- $recursive : bool = false
-
whether the checkin has to affect all children
- $note : string = null
-
a version note
Tags
Return values
bool —whether checkin succeeded or not
checkout()
Checks the item out
public
checkout([bool $recursive = false ][, int $UserID = null ]) : bool
Parameters
- $recursive : bool = false
-
whether the checkout has to affect all childrens
- $UserID : int = null
-
ID of the user the item has to be checked out for, if null the current user is taken
Tags
Return values
bool —whether checkout succeeded or not
compareFormattedValueTo()
Compares the formatted content whether it is marked as changed to an old value
public
compareFormattedValueTo(string $identifier, mixed $value[, int $languageID = null ][, string $medium = '' ]) : mixed
If you pass the label of the field as identifier be aware that labels are not unique and the value of the first field with that label will be returned.
Parameters
- $identifier : string
-
field ID or field label of the value to get
- $value : mixed
-
the new formatted value to compare to
- $languageID : int = null
-
the requested languageID of the identifier or null if the current default language should be used
- $medium : string = ''
-
an alternative medium the value should be formatted for ( CSItemMedium::HTML or CSItemMedium::TEXT are supported as standard). This parameter is passed to the CSTypes getValue() method.
Tags
Return values
mixed —copy()
Copies an existing item
public
copy(int $targetID[, int $position = CSITEM_POSITION_CHILD ][, bool $recursive = false ]) : CSItemApiItem
Parameters
- $targetID : int
-
ID of the targeted item
- $position : int = CSITEM_POSITION_CHILD
-
Position relative to the target item
- $recursive : bool = false
-
Whether the item is copied recursive
Tags
Return values
CSItemApiItem —A CSItemApiItem representing the new copy or null if copy was not successful.
createLink()
Creates a link to the MamFile in a given directory
public
createLink([string $mamPath = null ]) : CSMamFile
Parameters
- $mamPath : string = null
-
the complete path of the file including the filename which should be created, or the directory it should be created in
Tags
Return values
CSMamFile —a CSMamFile representing the link
delete()
Deletes an item
public
delete([bool $deleteReferencedCollections = false ]) : void
Parameters
- $deleteReferencedCollections : bool = false
-
whether all collections which reference this item should also be deleted
Tags
Return values
void —deleteKeyword()
Deletes a keyword from the current item
public
deleteKeyword(mixed $keyword) : mixed
Parameters
- $keyword : mixed
-
keyword ID or CSKeyword object containing the keywords
Tags
Return values
mixed —deleteKeywords()
Deletes all keywords for the current item
public
deleteKeywords() : mixed
Tags
Return values
mixed —deletePreviewFiles()
Deletes the cache files for the CSMamFile and its children and marks the previews as missing
public
deletePreviewFiles([bool $recursive = true ][, bool $removeImageSizeInformations = true ]) : void
Parameters
- $recursive : bool = true
-
whether previews in subdirectories should be also deleted
- $removeImageSizeInformations : bool = true
-
whether image proportions should also be marked to be recalculated
Tags
Return values
void —disableRightCheck()
This method can be used to disable the standard right checks for this object.
public
disableRightCheck() : bool
Even, if a user doesn't have the right to edit the item, he can check out/in or store it.
Tags
Return values
bool —enableRightCheck()
This method can be used to enable the standard right checks for this object.
public
enableRightCheck() : bool
If the right check was disabled previously by @disableRightCheck method. It is not necessary to enable the right check if it was not disabled previously.
Tags
Return values
bool —executeWorkflowAction()
executes a workflow action on the current record
public
executeWorkflowAction(mixed $action[, bool $recursive = false ][, string $note = '' ]) : bool
Parameters
- $action : mixed
-
an action object instance or the actionID of the action to execute
- $recursive : bool = false
-
whether this action should be executed recursively on all children
- $note : string = ''
-
the note that should be stored for the executed action
Tags
Return values
bool —whether the action has been executed successfully or not
exists()
Is the current file instance existing.
public
exists() : bool
Tags
Return values
bool —true/false
exportExcel()
Exports the Items to a Excel file (like in the Excel list export)
public
exportExcel([mixed $depth = true ][, array<string|int, mixed> $fields = array() ][, array<string|int, mixed> $rootIds = array() ][, string $fileName = '' ][, bool $csv = false ]) : string
Parameters
- $depth : mixed = true
-
the depth of searching children. Eighter an integer or true to get the values of all children
- $fields : array<string|int, mixed> = array()
-
limit the export to the given fields
- $rootIds : array<string|int, mixed> = array()
-
the optional rootIds which should be exported, otherwise the current ID is used as rootId.
- $fileName : string = ''
-
the name and path to write the excel file to
- $csv : bool = false
-
whether the export should be in Excel (default: false) or CSV Format (true)
Tags
Return values
string —the path to the export file
getAccessLevels()
Returns an array containing all accesslevels for this item
public
getAccessLevels([bool $showInherited = false ][, bool $showOnlyVisibles = false ]) : array<string|int, mixed>
Parameters
- $showInherited : bool = false
-
whether inherited accesslevels should also be returned
- $showOnlyVisibles : bool = false
-
whether only accesslevels should be returned which are visible to the current user
Tags
Return values
array<string|int, mixed> —an array containing all accesslevels in the form ID => Name
getActionHistory()
Retrieve item action history api
public
getActionHistory() : CSItemApiHistory
Tags
Return values
CSItemApiHistory —instance initialized with the current Item API
getAggregatedValue()
Aggregates the values for a given field
public
getAggregatedValue(array<string|int, mixed> $configurationId[, mixed $depth = true ][, bool $allowInheritance = true ][, bool $addFolders = true ][, array<string|int, mixed> $rootIds = null ][, int $languageId = null ]) : float
Parameters
- $configurationId : array<string|int, mixed>
-
the IDs for the configurations. Its values might either be integers describing configurationIDs or the standard fields like 'Label', 'StateID', 'WorkflowID'. 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 optional rootIds which should be searched, otherwise the current ID is used as rootId.
- $languageId : int = null
-
the languageId which should be searched
Tags
Return values
float —the aggregated value
getAllFields()
Return all known fields including the default api fields objects (like for Label, ExternalKey, ..) and the user defined fields (including system api fields with negative ID)
public
getAllFields() : array<string|int, CSItemApiField>
Tags
Return values
array<string|int, CSItemApiField> —getAttachmentFolder()
Returns the MAM path where attachments are stored
public
getAttachmentFolder() : string
Tags
Return values
string —the MAM path where attachments are stored
getAvailableWorkflowActions()
Returns the available Workflow Actions for the current item
public
getAvailableWorkflowActions([bool $bCheckRights = false ]) : array<string|int, Action>
Parameters
- $bCheckRights : bool = false
-
if true, only actions available for the current user are returned
Tags
Return values
array<string|int, Action> —array of Action Records which are available in the form ActionID => Action.
getBackReferences()
Returns all backreferences for an item
public
getBackReferences([string $className = null ][, string $attrID = null ]) : array<string|int, mixed>
Parameters
- $className : string = null
-
the optional name of the class of the referencing record
- $attrID : string = null
-
the optional id of the attribute of the referencing record
Tags
Return values
array<string|int, mixed> —an array of backreferences information array with the keys StartFieldID, Amount, LanguageID, ... and Reference containing the record referencing this item.
getChangedAt()
Return last change date of the item
public
getChangedAt([string $format = NULL ]) : string
Parameters
- $format : string = NULL
-
date format php.net/date
Tags
Return values
string —formatted change date
getChildren()
Returns an array with the children of an item
public
getChildren(int $levels) : array<string|int, CSItemApiItem>
Parameters
- $levels : int
-
depth of levels to descend to, if 0 all childrends are returned
Tags
Return values
array<string|int, CSItemApiItem> —array with the children items of the item
getChildrenIDs()
Returns an array with the ids of the children of an item
public
getChildrenIDs(int $levels[, bool $includeFolder = false ][, mixed $rootID = null ]) : array<string|int, mixed>
Parameters
- $levels : int
-
Depth of levels to descend to, if 0 all childrends are returned
- $includeFolder : bool = false
-
Whether the id of the rootFolder should also be returned
- $rootID : mixed = null
-
The optional ID or an array of IDs as root folder. If null, the current item is taken as root folder
Tags
Return values
array<string|int, mixed> —the children IDs of the item
getConfigurationClassId()
Returns the root configuration class of the item
public
getConfigurationClassId() : int
Tags
Return values
int —the root configuration class id of the item.
getConfigurationClassIds()
Returns the configuration class ids of the item.
public
getConfigurationClassIds([bool $bAllowInheritance = true ]) : array<string|int, mixed>
Parameters
- $bAllowInheritance : bool = true
-
Whether the value can be inherited from its parents if it is not defined in the item
Tags
Return values
array<string|int, mixed> —with the configuration class ids.
getConfigurationField()
Returns the CSItemApiField object for the current items configuration (Base Field)
public
getConfigurationField() : CSItemApiField
Tags
Return values
CSItemApiField —the Field representing the configuration
getContextFolder()
Returns the mam path of a context folder (object folder) for the current item (@see CSMam::getContextFolder())
public
getContextFolder() : string
Tags
Return values
string —the path of the requested context folder
getCreatedAt()
Return creation date of the item
public
getCreatedAt([string $format = NULL ]) : string
Parameters
- $format : string = NULL
-
date format php.net/date
Tags
Return values
string —formatted creation date
getCrossReferencedViews()
Returns all CSItemApiViews referencing this item
public
getCrossReferencedViews([bool $returnOnlyIds = false ]) : array<string|int, mixed>
Parameters
- $returnOnlyIds : bool = false
-
whether the views or only the IDs should be returned
Tags
Return values
array<string|int, mixed> —either an array of IDs or of CSItemApiViews objects
getCSImage()
Returns a item image as a cs:image CSTag
public
getCSImage(int $attrID[, array<string|int, mixed> $params = array() ][, string $wrapHTML1 = null ][, string $wrapHTML2 = null ]) : string
Parameters
- $attrID : int
-
the id of the attribute which contains the image, or directly the value as a json string
- $params : array<string|int, mixed> = array()
-
additional parameter for the cs:image CSTag
- $wrapHTML1 : string = null
-
HTML code which will be put before the cs:image CSTag
- $wrapHTML2 : string = null
-
HTML code which will be put after the cs:image CSTag
Tags
Return values
string —a item image as a cs:image CSTag
getCTime()
Return the creation date for the current file.
public
getCTime([string $format = null ]) : string
Parameters
- $format : string = null
-
the format of the date. It can be any format which is available in the php date() method call.
Tags
Return values
string —the creation date of the of the file.
getDataCTime()
Return creation date of CONTENTSERV data entry for current file
public
getDataCTime([string $format = null ]) : string
Parameters
- $format : string = null
-
date format php.net/date
Tags
Return values
string —formatted creation date
getDataMTime()
Return modification date of CONTENTSERV data entry for current file
public
getDataMTime([string $format = null ]) : string
Parameters
- $format : string = null
-
date format php.net/date
Tags
Return values
string —formatted creation date
getDefaultLanguageID()
Returns the ID of the default language from the current session.
public
getDefaultLanguageID() : int
Tags
Return values
int —the default language for this item
getDocumentLanguage()
returns the document language for the current document
public
getDocumentLanguage() : object
Tags
Return values
object —the language as CSLanguage-object if value is set otherwise null
getDocumentLanguageID()
returns the document language id for the current document
public
getDocumentLanguageID() : int
Tags
Return values
int —the language id if value is set otherwise 0
getDocumentLink()
Returns a HTML Link to a document of the product
public
getDocumentLink(int $attrID, mixed $text[, array<string|int, mixed> $params = array() ][, string $wrapHTML1 = null ][, string $wrapHTML2 = null ], int $filesizeprec[, mixed $decseperator = '.' ]) : string
Parameters
- $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 = null
-
HTML code which will be put before the Tag
- $wrapHTML2 : string = null
-
HTML code which will be put after the Tag
- $filesizeprec : int
-
the number of decimals of the filesize
- $decseperator : mixed = '.'
-
this char will be used as decimal seperator in the filesize
Tags
Return values
string —getDownloadLink()
Returns the URL of the link, where the user can download the file.
public
getDownloadLink([bool $bDownloadAsZip = false ][, string $sBase = 'relative' ][, string $sDownloadFileName = null ][, bool $bDownloadAsMacBinary = false ][, string $sDownloadContext = '' ]) : string
Parameters
- $bDownloadAsZip : bool = false
-
whether the download should be zipped
- $sBase : string = 'relative'
-
base of the link can be one of the following values: relative (default), external, internal
- $sDownloadFileName : string = null
-
the name the downloaded file should have
- $bDownloadAsMacBinary : bool = false
-
@deprecated whether the file should have the mac binary format (only available on MAC Servers)
- $sDownloadContext : string = ''
-
The context of the download call
Tags
Return values
string —the URL where the user may download the file
getDriverFile()
Returns the MAM driver file API object of the file.
public
getDriverFile([bool $bForWriting = false ][, bool $bCreateVersionIfMissing = false ]) : CSMamDriverFile
The API object provides information of the original or the version file if the original file is not allowed to be modified.
Parameters
- $bForWriting : bool = false
-
Whether the path should be returned, the file should be written to or it should be loaded from
- $bCreateVersionIfMissing : bool = false
-
Whether the original file should be copied, if $bForWriting is activated and the temporary file is not available
Tags
Return values
CSMamDriverFile —The MAM driver file API object of the current file.
getDuplicatesByMD5()
Returns the duplicate files with the same MD5 hash of the current file.
public
getDuplicatesByMD5() : array<string|int, mixed>
Tags
Return values
array<string|int, mixed> —An array in the structure e.g. array(ID => CSMamFile Object) If the file has no MD5 hash, the result is an empty array.
getEditorURL()
Returns the URL to the backend editor for this Item
public
getEditorURL([bool $checkout = false ]) : string
Parameters
- $checkout : bool = false
-
whether the document should be checked out for the current user
Tags
Return values
string —the relative URL to the backend editor
getEXIF()
Retrieve EXIF informations for this file
public
getEXIF([string $key = null ]) : mixed
Parameters
- $key : string = null
-
the key of the exif value. If empty all EXIF data is returned.
Tags
Return values
mixed —the EXIF data
getExternalKey()
Returns the external key of the item
public
getExternalKey() : string
Tags
Return values
string —external key of the item
getField()
Returns a specific field of an item
public
getField(string $identifier) : CSItemApiField
If you pass the label of the field as identifier be aware that labels are not unique and the first field with that label will be returned.
Parameters
- $identifier : string
-
ID or label of the field
Tags
Return values
CSItemApiField —object
getFieldByIdentifier()
public
getFieldByIdentifier(string|int $mFieldIdOrDefaultFieldName) : CSItemApiField
Parameters
- $mFieldIdOrDefaultFieldName : string|int
Tags
Return values
CSItemApiField —getFieldIDs()
Returns all the FieldsID of the item without the base field
public
getFieldIDs() : array<string|int, mixed>
Tags
Return values
array<string|int, mixed> —array of CSItemField IDs with the children of the base field
getFields()
Returns all the fields of the item without the base field
public
getFields() : array<string|int, CSItemApiField>
Tags
Return values
array<string|int, CSItemApiField> —array of CSItemFields objects with the children of the base field
getFieldStateID()
Gets the Workflow State for a given field
public
getFieldStateID(int $configurationID[, int $languageID = null ], int $subType) : int
Parameters
- $configurationID : int
-
the field for which the State is requested
- $languageID : int = null
-
the language for which the State is requested
- $subType : int
-
this parameter can define the optional subtype of the value
Tags
Return values
int —the StateID of the Workflow
getFileBaseName()
Obtain filename without the file suffix
public
getFileBaseName([bool $stripType = false ]) : string
Parameters
- $stripType : bool = false
-
whether the filetype should be removed
Tags
Return values
string —the name of the file
getFileContent()
Returns the file content of the MamFile.
public
getFileContent() : string
Tags
Return values
string —the content of the file
getFileName()
Obtain the FileName without directories
public
getFileName() : string
Tags
Return values
string —the FileName of the CSMamFile
getFilePath()
Returns the Path of the file
public
getFilePath() : string
Tags
Return values
string —Path of the file
getFiles()
Obtain list of CSMamFile objects contained in current folder
public
getFiles([bool $includeFiles = true ][, bool $includeFolders = false ][, bool $returnOnlyIDs = false ]) : array<string|int, CSMamFile>
Parameters
- $includeFiles : bool = true
-
list files
- $includeFolders : bool = false
-
list folders
- $returnOnlyIDs : bool = false
-
whether CSMamFile objects or only IDs should be returned
Tags
Return values
array<string|int, CSMamFile> —List of CSMamFile objects
getFileSize()
Retrieve formatted file size information. Returns "0" for folders.
public
getFileSize([bool $bFormatHumanReadable = true ]) : string
Parameters
- $bFormatHumanReadable : bool = true
-
whether the size is returned in bytes (false) or in a human readable form (true)
Tags
Return values
string —the file size
getFileType()
Obtain file type suffix, e.g. "jpg"
public
getFileType() : string
Tags
Return values
string —file suffix
getFolder()
Returns the folder of the CSMamFile
public
getFolder() : CSMamFile
Tags
Return values
CSMamFile —the parent of the file
getFormattedValue()
Gets a formatted value of an item.
public
getFormattedValue(string $mIdentifier[, int $iLanguageId = null ][, bool $bAllowInheritance = true ], int $iSubType[, string $mMedium = '' ][, int $iContextId = null ]) : mixed
If you pass the label of the field as identifier be aware that labels are not unique and the value of the first field with that label will be returned.
Parameters
- $mIdentifier : string
-
Field ID or field label of the value to get
- $iLanguageId : int = null
-
The requested languageID of the identifier or null if the current default language should be used
- $bAllowInheritance : bool = true
-
Whether the value can be inherited from its parents if it is not defined in the item
- $iSubType : int
-
This parameter can define the optional subtype of the value
- $mMedium : string = ''
-
An alternative medium the value should be formatted for ( '' for CSItemMedium::DEFAULT or CSItemMedium::TEXT for 'TEXT' are supported as standard). This parameter is passed to the CSTypes getValue() method. One of the CSItemMedium constants
- $iContextId : int = null
-
The context id for which the value should be retrieved
Tags
Return values
mixed —The formatted value as string
getFormattedValues()
Loads some values directly from the database and formats them automatically.
public
getFormattedValues([array<string|int, mixed> $configurationIds = array() ][, mixed $depth = TRUE ][, bool $allowInheritance = TRUE ][, bool $addFolders = TRUE ][, array<string|int, mixed> $rootIds = NULL ][, mixed $languageId = NULL ][, array<string|int, mixed> $sortFields = array() ][, bool $groupByLanguageID = FALSE ][, bool $checkRights = FALSE ][, string $medium = '' ][, bool $returnSubTypes = TRUE ][, array<string|int, mixed> $additionalOptions = array() ][, int $iContextId = null ]) : array<string|int, mixed>
This is a performant method to receive MULTIPLE values at once.
Parameters
- $configurationIds : array<string|int, mixed> = array()
-
the IDs for the configurations. Its values might either be integers describing configurationIDs or the standard fields like 'Label', 'StateID', 'WorkflowID'. If this value is null then all fields are fetched
- $depth : mixed = TRUE
-
the depth of searching children. Either 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 optional rootIds which should be searched, otherwise the current ID is used as rootId.
- $languageId : mixed = NULL
-
the languageId which should be searched as integer or an array of language ids, which should be searched. The array should only be used together with $groupByLanguageID.
- $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
-
wether the visibility of items and attributes 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 : int = null
-
The context id for which the values should be retrieved
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
getGrid()
Returns an value from an appropriate field as CSGrid object
public
getGrid(string $iIdentifier[, int $iLanguageID = NULL ][, bool $bAllowInheritance = TRUE ], int $iSubType) : CSGrid
Parameters
- $iIdentifier : string
-
Field ID or field label of the value to get
- $iLanguageID : int = NULL
-
The requested languageID of the identifier or null if the current default language should be used
- $bAllowInheritance : bool = TRUE
-
Whether the value can be inherited from its parents if it is not defined in the item
- $iSubType : int
-
The fields subtype
Tags
Return values
CSGrid —The value of the field as CSGrid
getIcon()
Retrieve image URL of an icon representing the current file
public
getIcon([int $sizeType = false ]) : string
Parameters
- $sizeType : int = false
-
if set to true or 1 a larger icon will be used if available, if set to 2 a huge icon
Tags
Return values
string —icon URL
getID()
Returns the ID of the item
public
getID() : int
Tags
Return values
int —the ID of the item
getImage()
Returns the path of the image in the ImageServer.
public
getImage([int $width = null ][, int $height = null ][, int $format = null ][, int $colorspace = null ][, int $resolution = null ][, bool $useMaster = true ][, string $additionalParams = '' ]) : string
Parameters
- $width : int = null
-
target image width
- $height : int = null
-
target image height
- $format : int = null
-
target image format (jpg, gif, ...)
- $colorspace : int = null
-
target image colorspace (rgb, cmyk)
- $resolution : int = null
-
resolution in dpi of the target image
- $useMaster : bool = true
-
whether the master image or the original image should be used for transformation
- $additionalParams : string = ''
-
additional parameters which should be appended to the ImageServer URL
Tags
Return values
string —the URL of the CSMamFile in the ImageServer
getImageColorspace()
Returns the colorspace of the file, if it is an image.
public
getImageColorspace() : string
Tags
Return values
string —the colorspace of the image (rgb, cmyk, ...)
getImageFile()
Returns the file stream of the image in the ImageServer.
public
getImageFile([int $iWidth = null ][, int $iHeight = null ][, string $sFormat = null ][, string $sColorSpace = null ][, int $iResolution = null ][, bool $bUseMaster = true ][, string $aAdditionalParams = '' ]) : CSFileStream|null
Parameters
- $iWidth : int = null
-
The target width of the image.
- $iHeight : int = null
-
The target height of the image.
- $sFormat : string = null
-
Target image format (jpg, gif, ...)
- $sColorSpace : string = null
-
Target image colorspace (rgb, cmyk)
- $iResolution : int = null
-
Resolution in dpi of the target image
- $bUseMaster : bool = true
-
Whether the master image or the original image should be used for transformation
- $aAdditionalParams : string = ''
-
Additional parameters which should be appended to the ImageServer URL
Tags
Return values
CSFileStream|null —getImageHeight()
Returns the height of the file in pixel, if it is an image.
public
getImageHeight() : int
Tags
Return values
int —the height of the image
getImageResolution()
Returns the resolution of the file in dpi, if it is an image.
public
getImageResolution() : int
Tags
Return values
int —the resolution of the image
getImageServerID()
Returns the ID which must be passed to the ImageServer URL
public
getImageServerID() : string
Tags
Return values
string —the ImageServerID
getImageServerURL()
Returns the URL of the ImageServer, which displays this item (or preview image of this item).
public
getImageServerURL([int $width = null ][, int $height = null ][, string $base = 'relative' ][, int $format = null ][, int $colorspace = null ][, int $resolution = null ][, bool $force = false ][, bool $useMaster = true ][, string $additionalParams = '' ]) : string
Parameters
- $width : int = null
-
target image width
- $height : int = null
-
target image height
- $base : string = 'relative'
-
base of the link can be one of the following values: relative (default), external, internal
- $format : int = null
-
target image format (jpg, gif, ...)
- $colorspace : int = null
-
target image colorspace (rgb, cmyk)
- $resolution : int = null
-
resolution in dpi of the target image
- $force : bool = false
-
whether missing images should be forced to be created on the fly
- $useMaster : bool = true
-
whether the master image or the original image should be used for transformation
- $additionalParams : string = ''
-
additional parameters which should be appended to the ImageServer URL
Tags
Return values
string —the URL of the CSMamFile in the ImageServer representing the current object or its preview
getImageServerURLForPreset()
Returns the URL of the ImageServer, which displays this file, based on the passed preset.
public
getImageServerURLForPreset(CSMamExportPreset|int $preset[, string $base = 'relative' ]) : string
Parameters
- $preset : CSMamExportPreset|int
-
the preset to use (name, id or a CSMamExportPreset)
- $base : string = 'relative'
-
base of the link can be one of the following values: relative (default), external, internal
Tags
Return values
string —the URL of the CSMamFile in the ImageServer
getImageWidth()
Returns the width of the file in pixel, if it is an image.
public
getImageWidth() : int
Tags
Return values
int —the width of the image
getIPTC()
Retrieve IPTC informations for this file
public
getIPTC([string $key = null ]) : mixed
Parameters
- $key : string = null
-
the key of the exif value. If empty all IPTC data are returned.
Tags
Return values
mixed —the IPTC data
getItem()
Returns the Item Record which corresponds to the CSItemApiItem object
public
getItem() : Item
Tags
Return values
Item —the Record of this object
getItemOwner()
Returns the UserID of the owner of the item
public
getItemOwner() : int
Tags
Return values
int —the ID of the User or 0
getKeywords()
Returns the keywords defined for the current file
public
getKeywords([bool $allowInheritage = true ][, bool $returnCSKeywordObjects = true ]) : array<string|int, mixed>
Parameters
- $allowInheritage : bool = true
-
whether also inherited keywords from parent items should be returned when inheritage is enabled for the item in the options.
- $returnCSKeywordObjects : bool = true
-
whether CSKeyword objects will be returned or the keywords will be returned as strings
Tags
Return values
array<string|int, mixed> —getLabel()
Returns the label of the item
public
getLabel([mixed $bGenerateDefaultLabel = false ]) : string
Parameters
- $bGenerateDefaultLabel : mixed = false
Tags
Return values
string —label of the item
getLabelPath()
Returns an array with the labels of an item.
public
getLabelPath([bool $bIncludeSelf = FALSE ][, int $iLanguageId = NULL ]) : array<string|int, string>
The array is sorted from the oldest to the youngest ancestor.
Parameters
- $bIncludeSelf : bool = FALSE
-
Whether the current item's label should be included in the list.
- $iLanguageId : int = NULL
-
The ID of the language for which the labels should be retrieved.
Tags
Return values
array<string|int, string> —An array of the labels path of the item.
getLinkedFile()
Returns the file a MamFile is linked to
public
getLinkedFile() : CSMamFile
Tags
Return values
CSMamFile —a CSMamFile representing the target of the link or the file itself, if it is not linked
getLocalFilesystemPath()
Returns the path of the file in the local filesystem where the file can be read from or should be written to If the path for reading is requested and the original file is not accessible through the local filesystem a copy is downloaded and its path is returned
public
getLocalFilesystemPath([bool $forWriting = false ][, bool $copyIfMissing = false ][, bool $returnRelativePath = false ]) : string
Parameters
- $forWriting : bool = false
-
whether the path should be returned, the file should be written to or it should be loaded from
- $copyIfMissing : bool = false
-
whether the original file should be copied, if $forWriting is activated and the temporary file is not available
- $returnRelativePath : bool = false
-
whether to return the relative or absolute path to the desired file
Tags
Return values
string —the absolute path of the file in the local filesystem where it should be loaded from or written to
getLockUser()
returns the user object for the user id the file has been locked for
public
getLockUser() : CSUser
Tags
Return values
CSUser —the user object
getMamPath()
Returns the MamPath of the file
public
getMamPath() : string
Tags
Return values
string —the MamPath of the file
getMasterDimensions()
Returns the pixel dimensions of the master image of a given MAM image file.
public
getMasterDimensions() : array<string|int, mixed>
Tags
Return values
array<string|int, mixed> —A size structure, containing the pixel dimensions of the master image. If the master dimensions cannot be determined, the result is NULL.
getMasterPreviewCacheFile()
Returns the master preview cache file to create / embed previews from / in webpages or other applications.
public
getMasterPreviewCacheFile(int $iWidth, int $iHeight[, string $sFileType = '' ]) : CSMamVolumeCacheFile
Parameters
- $iWidth : int
-
The optional "width" parameter to define the corresponding preview cache file for the given width.
- $iHeight : int
-
The optional "height" parameter to define the corresponding preview cache file for the given height.
- $sFileType : string = ''
-
The target file type of the master preview cache file.
Tags
Return values
CSMamVolumeCacheFile —getMasterPreviewPath()
Returns the path of the master preview in the local filesystem, to create / embed previews from / in webpages or other applications.
public
getMasterPreviewPath([bool $bForceWebImage = true ][, string $sGeometry = '' ]) : string
Parameters
- $bForceWebImage : bool = true
-
If set to TRUE, the resulting path will point to a master web image (jpg or gif), which could be embedded in webpages. If set to FALSE, the path will point to a type-specific master file (pdf, jpg, ...), which can be embedded in other applications and may contain OPI information.
- $sGeometry : string = ''
-
The optional geometry the file should have ("[WIDTH]x[HEIGHT]"). If the Parameter is omitted or consists of an empty string, the master image is selected.
Tags
Return values
string —The path of the requested master preview file.
getMetaData()
Returns object of CSFileMetadata.
public
getMetaData(int $iType) : CSFileMetadata
Parameters
- $iType : int
-
The Metadata Type (@see CSMetaData constants)
Tags
Return values
CSFileMetadata —getMetaDataClass()
Returns the metadata class for the MamFile class.
public
getMetaDataClass() : CSFileMetaData
Tags
Return values
CSFileMetaData —getMetaDataTypes()
Returns the supported meta types for the current class.
public
getMetaDataTypes() : array<string|int, mixed>
Tags
Return values
array<string|int, mixed> —getMTime()
Return the date of last change on the current file.
public
getMTime([string $format = null ]) : string
Parameters
- $format : string = null
-
the format of the date. It can be any format which is available in the php date() method call.
Tags
Return values
string —the date of the last modification of the file.
getNewInstance()
Returns a new instance of the current object for a new ID
public
getNewInstance(mixed $ID) : CSItemApiItem
Parameters
- $ID : mixed
-
the ID in form of an integer or as an Item
Tags
Return values
CSItemApiItem —new instance of the current object for a new ID
getOwner()
Returns the UserID of the owner of the item, if it is checked out.
public
getOwner() : int
Tags
Return values
int —the ID of the User or 0
getParent()
Returns the parent of an CSItemApiItem
public
getParent() : CSItemApiItem
Tags
Return values
CSItemApiItem —the parent of the item
getPath()
Returns an array with the ancestors of an item
public
getPath([bool $returnOnlyIDs = false ]) : array<string|int, mixed>
The array is sorted from the oldest to the youngest ancestor
Parameters
- $returnOnlyIDs : bool = false
-
whether the path should be returned as IDs (true) or as Item objects (false)
Tags
Return values
array<string|int, mixed> —the ancestors of the item
getPredecessor()
Returns the Predecessor of an CSItemApiItem
public
getPredecessor() : CSItemApiItem
The Predecessor is the CSItemApiItem that is pointed at through the CopyOf Attribute. The CopyOf Attribute is automatically set upon duplicate operations and points to the item, that was duplicated.
Tags
Return values
CSItemApiItem —the predecessor of the item
getPreviewFields()
Returns fields that were marked as preview fields
public
getPreviewFields([bool $bIncludeTextFields = true ][, bool $bIncludeImageFields = true ][, bool $bReturnOnlyFieldsFromCurrentItem = false ]) : array<string|int, CSItemApiField>
Parameters
- $bIncludeTextFields : bool = true
-
If true also Text fields are returned
- $bIncludeImageFields : bool = true
-
If true also Images fields are returned
- $bReturnOnlyFieldsFromCurrentItem : bool = false
-
If true then only fields for the current item should be returned.
Tags
Return values
array<string|int, CSItemApiField> —array of fields that are marked as preview fields
getPreviewImage()
Returns the path of the preview image in the ImageServer.
public
getPreviewImage([int $width = null ][, int $height = null ][, int $format = null ][, int $colorspace = null ][, int $resolution = null ]) : string
This function is only a placeholder, please use getPreviewImageURL method instead.
Parameters
- $width : int = null
-
target image width
- $height : int = null
-
target image height
- $format : int = null
-
target image format (jpg, gif, ...)
- $colorspace : int = null
-
target image colorspace (rgb, cmyk)
- $resolution : int = null
-
resolution in dpi of the target image
Tags
Return values
string —the URL of the CSMamFile in the ImageServer
getPreviewImageURL()
Returns the path of the preview image in the ImageServer.
public
getPreviewImageURL([int $width = null ][, int $height = null ][, int $format = null ][, int $colorspace = null ][, int $resolution = null ][, string $base = 'relative' ]) : string
Parameters
- $width : int = null
-
target image width
- $height : int = null
-
target image height
- $format : int = null
-
target image format (jpg, gif, ...)
- $colorspace : int = null
-
target image colorspace (rgb, cmyk)
- $resolution : int = null
-
resolution in dpi of the target image
- $base : string = 'relative'
-
the URL building method as in @see CS::getLinkToResource()
Tags
Return values
string —the URL of the CSMamFile in the ImageServer
getRating()
Retrieve item rating api
public
getRating() : object
Tags
Return values
object —CSItemRating instance initialized with the current Item API
getReferenceConfigurations()
Returns all fields of the configuration (a.k.a. class) associated with the references for an attribute of an item.
public
getReferenceConfigurations(mixed $mRefSourceAttr[, bool $bIncludeContainerConfig = FALSE ]) : array<string|int, mixed>
Parameters
- $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.
getReferencedItem()
Returns the first referenced item for a reference CSType Attribute
public
getReferencedItem(int $attrID[, int $languageID = NULL ]) : CSItemApiItem
Parameters
- $attrID : int
-
the id of the attribute which contains the references
- $languageID : int = NULL
-
the language of the requested references
Tags
Return values
CSItemApiItem —or NULL if no target item is available
getReferenceList()
Returns the reference list for an attribute of the item
public
getReferenceList(int|CSItemApiField|Itemconfiguration $attrID[, int $languageID = null ], mixed $iContextId) : CSItemApiReferenceList
Parameters
- $attrID : int|CSItemApiField|Itemconfiguration
-
The id of the attribute which contains the references or a field object
- $languageID : int = null
-
The language of the requested references
- $iContextId : mixed
Tags
Return values
CSItemApiReferenceList —getReferences()
Returns the references for an attribute of the item It is recommended to use CSItemApiReferenceList API instead of this method. (getReferenceList method)
public
getReferences(int $attrID[, mixed $details = false ][, bool $showInherited = true ][, int $languageID = null ], mixed $iContextId) : array<string|int, mixed>
Parameters
- $attrID : int
-
the id of the attribute which contains the reference
- $details : mixed = false
-
if set to true the result is returned as an array {'References' => { 'Reference' => $referenceObject, 'Multiplicity' => $multiplicity, 'Data' => $jsonObject), ...}, 'DeletedIDs' => $idList, 'InheritedIDs' => $idList}. If it is set to false only the $referenceObject is returned. If set to 'IDList' only the IDs are returned.
- $showInherited : bool = true
-
if inherited references should be added for additive inheritance
- $languageID : int = null
-
the language of the requested reference
- $iContextId : mixed
Tags
Return values
array<string|int, mixed> —an array of references either in a second array or directly as objects
getReferencesValues()
Returns the additional values that are associated with the references for an attribute of an item.
public
getReferencesValues(mixed $mRefSourceAttr[, mixed $mRequestedAttrKeys = NULL ][, bool $bShowInherited = TRUE ][, int $iLanguageId = NULL ]) : array<string|int, mixed>
Parameters
- $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. If a second or third target with the given ID is existing, it may be accessed using a suffix _[COUNTER], e.g. 11, 11_2, 11_3, ...
- $bShowInherited : bool = TRUE
-
Set to TRUE if inherited references should be added for additive inheritance.
- $iLanguageId : int = NULL
-
The language of the references.
Tags
Return values
array<string|int, mixed> —A two-dimensional array containing the reference attribute values. The first dimension designates the IDs of the reference target item(s), the second dimension is indexed by the original $mRequestedAttrKeys.
getReferenceValue()
Returns a specific additional value that is associated with a specific reference for an attribute of an item.
public
getReferenceValue(mixed $mRefSourceAttr, int $iRefTargetItemId, mixed $mRequestedAttrKey[, bool $bShowInherited = TRUE ][, int $iLanguageId = NULL ]) : string
Parameters
- $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 target ID 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
getReferenceValues(mixed $mRefSourceAttr, int $iRefTargetItemId[, mixed $mRequestedAttrKeys = NULL ][, bool $bShowInherited = TRUE ][, int $iLanguageId = NULL ]) : array<string|int, mixed>
Parameters
- $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 target ID of the referenced item that the values will be retrieved for. If a second or third target with the given ID is existing, it may be accessed using a suffix _[COUNTER], e.g. 11, 11_2, 11_3, ...
- $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.
getRoles()
Returns all roles the current user has for this item
public
getRoles() : array<string|int, mixed>
Tags
Return values
array<string|int, mixed> —an array containing all roles in the form ID => Name
getSimpleSearchableFieldIds()
Fetches the list of simple searchable field IDs
public
getSimpleSearchableFieldIds() : array<string|int, mixed>
Tags
Return values
array<string|int, mixed> —getStandardFields()
Returns all the standard fields of the item and their API representation Note: As the CSItemFields are just wrappers not to be designed to display standard fields not all available methods will work for them
public
getStandardFields() : array<string|int, CSItemApiField>
Tags
Return values
array<string|int, CSItemApiField> —An array where the keys are the labels and the values CSItemApiFields objects
getTable()
Gets a TableAPI-Object for a given Field ID
public
getTable(string $fieldID[, int $languageID = null ]) : CSItemApiTable
Parameters
- $fieldID : string
-
field ID or field label of the value to get
- $languageID : int = null
-
the requested languageID of the identifier or null if the current default language should be used
Tags
Return values
CSItemApiTable —a CSItemApiTable object for the given field
getTableRow()
Returns the CSItemApiTableRow object for a given TableRowID
public
getTableRow(int $tableRowID) : CSItemApiTableRow
Parameters
- $tableRowID : int
-
the ID
Tags
Return values
CSItemApiTableRow —the TableRow object
getUploadLink()
Returns the html code for a link where one can upload a new file to the current file.
public
getUploadLink([string $label = 'Upload' ][, string $onAfterUploadJs = '' ]) : string
Parameters
- $label : string = 'Upload'
-
the label which should be displayed within the link
- $onAfterUploadJs : string = ''
-
Parameter "event" represents the native event. Second Parameter "files" represents an array of uploaded files.
Tags
Return values
string —the html code managing the complete upload or null if uploading is not allowed in this directory
getValue()
Gets a value of an item
public
getValue(string $mIdentifier[, int|null $iLanguageId = NULL ][, bool $bAllowInheritance = TRUE ][, int $iValueType = CSITEM_VALUES_UNFORMATTED ], int $iSubType[, int $iContextId = null ]) : mixed
If you pass the label of the field as identifier be aware that labels are not unique and the value of the first field with that label will be returned.
Parameters
- $mIdentifier : string
-
Field ID or field name of the value to get.
- $iLanguageId : int|null = NULL
-
The requested languageID of the identifier or null if the current default language should be used.
- $bAllowInheritance : bool = TRUE
-
Whether the value can be inherited from its parents if it is not defined in the item
- $iValueType : int = CSITEM_VALUES_UNFORMATTED
-
The CSITEM_VALUES_ type the values are formatted. Possible values are CSITEM_VALUES_UNFORMATTED, CSITEM_VALUES_FORMATTED, CSITEM_VALUES_ARRAY and CSITEM_VALUES_COMPARATOR.
- $iSubType : int
-
This parameter can define the optional subtype of the value
- $iContextId : int = null
-
The context id for which the value should be retrieved
Tags
Return values
mixed —the value either as string or as array, if the $valueType CSITEM_VALUES_ARRAY is specified
getValueAsImageURL()
Returns the URL of the ImageServer, which displays this file.
public
getValueAsImageURL(string $identifier[, int $languageID = null ][, bool $allowInheritance = true ][, int $width = null ][, int $height = null ][, string $base = 'relative' ][, int $format = null ][, int $colorspace = null ][, int $resolution = null ][, bool $force = false ][, bool $useMaster = true ]) : mixed
Parameters
- $identifier : string
-
field ID or field label of the value to get
- $languageID : int = null
-
the requested languageID of the identifier or null if the current default language should be used
- $allowInheritance : bool = true
-
whether the value can be inherited from its parents if it is not defined in the item
- $width : int = null
-
target image width
- $height : int = null
-
target image height
- $base : string = 'relative'
-
base of the link can be one of the following values: relative (default), external, internal
- $format : int = null
-
target image format (jpg, gif, ...)
- $colorspace : int = null
-
target image colorspace (rgb, cmyk)
- $resolution : int = null
-
resolution in dpi of the target image
- $force : bool = false
-
whether missing images should be forced to be created on the fly
- $useMaster : bool = true
-
whether the master image or the original image should be used for transformation
Tags
Return values
mixed —the URL of the CSMamFile in the ImageServer - if it is only one as string otherwise as array of urls
getValueForConfig()
Queries the value defined by the getter object
public
getValueForConfig(CSItemValueGetter $oGetter) : mixed
Parameters
- $oGetter : CSItemValueGetter
-
The definition of the getter that identifies the value to retrieve
Tags
Return values
mixed —The value matching the getter
getValues()
Loads some values directly from the database and do not format them automatically.
public
getValues([array<string|int, mixed> $configurationIds = array() ][, mixed $depth = TRUE ][, bool $allowInheritance = TRUE ][, bool $addFolders = TRUE ][, array<string|int, mixed> $rootIds = NULL ][, mixed $languageId = NULL ][, int $valueType = 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() ][, int $iContextId = null ]) : array<string|int, mixed>
This is a performant method to receive MULTIPLE values at once. There are three types the values can be returned as:
- CSITEM_VALUES_UNFORMATTED (DEFAULT): The values are returned as they are stored in the database. This is the fastes call, but might sometimes be crypted.
- CSITEM_VALUES_FORMATTED: The values are returned corresponding to the settings of their cstypes.
- CSITEM_VALUES_ARRAY: The values are returned in form of an array, containing the unformatted and formatted value and further detail informations which are defined in the cstype.
Parameters
- $configurationIds : array<string|int, mixed> = array()
-
the IDs for the configurations. Its values might either be integers describing configurationIDs or the standard fields like 'Label', 'StateID', 'WorkflowID'. If this value is null then all fields are fetched
- $depth : mixed = TRUE
-
the depth of searching children. Either 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 optional rootIds which should be searched, otherwise the current ID is used as rootId.
- $languageId : mixed = NULL
-
the languageId which should be searched as integer or an array of language ids, which should be searched. The array should only be used together with $groupByLanguageID.
- $valueType : int = CSITEM_VALUES_UNFORMATTED
-
the CSITEM_VALUES_ type the values are formated. Possible values are CSITEM_VALUES_UNFORMATTED, CSITEM_VALUES_FORMATTED and CSITEM_VALUES_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
-
wether the visibility of items and attributes 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 : int = null
-
The context id for which the values should be retrieved
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
getValuesForConfig()
Loads all values matching the getter definition.
public
getValuesForConfig(CSItemValuesGetter $oGetter) : array<string|int, mixed>
Parameters
- $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
getVolume()
Returns the CSMamVolume of the CSMamFile
public
getVolume() : CSMamVolume
Tags
Return values
CSMamVolume —the volume the file is defined in
getWebDavJSCode()
generates javascript code to open the current file in a webdav client
public
getWebDavJSCode([string $objectPrefix = '' ][, string $methodName = 'openWebDavDocument' ][, mixed $includeTicketID = true ]) : string
Parameters
- $objectPrefix : string = ''
-
a object prefix that defines where to execute the javascript code (e.g. parent) (optional)
- $methodName : string = 'openWebDavDocument'
-
the name of the method in the CSMam.js API to be called (optional)
- $includeTicketID : mixed = true
Tags
Return values
string —the JS-code for the webdav call
getWrapperItem()
Returns the cluster item of the current item API item.
public
getWrapperItem() : CSItemApiWrapperItem
Tags
Return values
CSItemApiWrapperItem —getXMP()
Retrieve XMP headers for this file
public
getXMP([string $key = null ]) : mixed
Parameters
- $key : string = null
-
the key of the exif value. If empty all IPTC data are returned.
Tags
Return values
mixed —the XMP header
hasPreviewMaster()
Check for a preview master file
public
hasPreviewMaster() : bool
Tags
Return values
bool —true if a master preview has been set, false otherwise
hasVersionFile()
public
hasVersionFile(mixed $iVersionNr[, mixed $bCreateIfMissing = false ]) : mixed
Parameters
- $iVersionNr : mixed
- $bCreateIfMissing : mixed = false
Tags
Return values
mixed —importExcel()
Imports on Excel or CSV file in the format of the {@link CSItemApiItem::exportExcel} format.
public
importExcel(string $fileName[, string $defaultAction = 'U' ]) : string
If the ParentID is an empty string "" in the import, this Item is used as parent
Parameters
- $fileName : string
-
the Excel or CSV file shich should be imported
- $defaultAction : string = 'U'
-
the _ImportAction which is used, if no ImportAction is set in the data (D: Delete, I: Insert, A: Append, U: Update, E: ExternalKey (Update or Append whether ExternalKey matches an Item))
Tags
Return values
string —the HTML representation of all changes (like in the List Imports)
isArchived()
Returns whether the file is archived
public
isArchived() : bool
Tags
Return values
bool —whether the file is archived
isCheckedOut()
Check if the current item is checked out by the current user
public
isCheckedOut([bool $isCheckedOutForCurrentUser = true ]) : bool
Parameters
- $isCheckedOutForCurrentUser : bool = true
-
whether it is checked if the file is checked out for the current (true) or any (false) user.
Tags
Return values
bool —whether the item is checked out
isEditable()
Chechs whether the current user has the right to edit the item
public
isEditable([int $languageID = null ]) : bool
Parameters
- $languageID : int = null
-
the optional languageID to check whether the user may edit the language or any language if not set
Tags
Return values
bool —whether the user may edit this item
isFolder()
Check if the file instance is a folder.
public
isFolder() : bool
Tags
Return values
bool —true/false
isForeignCheckedOut()
Check if the current item is checked out by a user who is not the current user (a/k/a "foreign check-out")
public
isForeignCheckedOut() : bool
Tags
Return values
bool —TRUE, if the item is checked out by a user different from the current user, FALSE otherwise.
isImage()
Returns true if the file is an image
public
isImage([mixed $onlyWebImages = false ]) : bool
Parameters
- $onlyWebImages : mixed = false
-
if true only web compatible images are considered as image
Tags
Return values
bool —true if the file is an image
isLink()
Returns true if the file is a link
public
isLink([mixed $onlyWebImages = false ]) : bool
Parameters
- $onlyWebImages : mixed = false
Tags
Return values
bool —true if the file is a link
isLocked()
returns whether the current file is locked
public
isLocked([int $forUserID = null ]) : bool
Parameters
- $forUserID : int = null
-
if passed the api checks whether the file is locked for the user with this id
Tags
Return values
bool —true if file is locked otherwise false
isLockedForOtherUser()
returns whether the current file is locked by another user as the current user
public
isLockedForOtherUser() : bool
Tags
Return values
bool —true if file is locked for another user otherwise false
isMetaDataLicenseActivated()
Returns a boolean value whether the license for meta data is activated or not.
public
isMetaDataLicenseActivated() : mixed
Tags
Return values
mixed —isMetaDataSupportActivated()
Returns a boolean whether the meta data support is activated or not.
public
isMetaDataSupportActivated() : bool
Tags
Return values
bool —isPrintfile()
Defines if file is valid printfile
public
isPrintfile() : bool
Tags
Return values
bool —true if the file is a whiteboard, indesign or pdf file
isRegistered()
Check if the current file instance is contained in a CSMamVolume of the MAM-Suite
public
isRegistered() : bool
Tags
Return values
bool —whether the file is contained in a CSMamVolume
isVideo()
Returns true if the file is a video
public
isVideo() : bool
Tags
Return values
bool —true if the file is a video
isViewable()
Checks whether the current user has the right to view the item
public
isViewable([int $languageID = null ]) : bool
Parameters
- $languageID : int = null
-
the optional languageID to check whether the user may view the language or any language if not set
Tags
Return values
bool —whether the user may view this item
isWritable()
Check for writing access on the current file instance. Not necessarily based on physical write ability of current user
public
isWritable() : bool
Tags
Return values
bool —true/false
loadVersion()
Loads a specific version with a given versionNr of the current item
public
loadVersion(int $versionNr) : void
Parameters
- $versionNr : int
-
the requested versionNr of the item
Tags
Return values
void —lock()
locks a file to prevent file system perations by another users
public
lock([int $forUserID = null ]) : int
Parameters
- $forUserID : int = null
-
locks the file for the user with the specified id. If no id is supplied the current user id is used
Tags
Return values
int —the id of the user the file has beed locked for
move()
Moves the item near to the target item
public
move(int $targetID[, int $position = CSITEM_POSITION_CHILD ]) : bool
Parameters
- $targetID : int
-
ID of the targeted item
- $position : int = CSITEM_POSITION_CHILD
-
Position relative to the target item
Tags
Return values
bool —True, if move has been executed successfully, otherwise false
removeImage()
Removes all image or document from an attribute in the product with a given url.
public
removeImage(int $attrID[, string $url = null ][, bool $doStore = false ]) : void
Parameters
- $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
- $doStore : bool = false
-
store the product for a persistent change
Tags
Return values
void —removeReference()
Removes the references for an attribute
public
removeReference(int $iAttrID, array<string|int, mixed> $aRemovedRefIDs[, int $iLanguageID = null ], mixed $iContextId) : bool
Parameters
- $iAttrID : int
-
the id of the attribute which contains the references
- $aRemovedRefIDs : array<string|int, mixed>
-
the array containing the ids of the references which should be removed
- $iLanguageID : int = null
-
the optional languageID
- $iContextId : mixed
Tags
Return values
bool —restore()
Returns whether the file is archived
public
restore() : bool
Tags
Return values
bool —whether the file is archived
restoreFromPreviewMaster()
Restore the live master from the uploaded preview master This will not start the sync
public
restoreFromPreviewMaster() : bool
Tags
Return values
bool —true if copy was created successful, false otherwise
searchContent()
Searches all items matching a given search criteria
public
searchContent(CSItemSearchFilter $find[, mixed $rootIds = null ][, mixed $depth = true ][, bool $checkInheritance = true ][, mixed $sortFields = array() ][, string $limit = '' ], int $cacheTime[, bool $bExtendedResult = false ]) : CSItemSearchResult|array<string|int, int>
Parameters
- $find : CSItemSearchFilter
-
the content which must be found.
- $rootIds : mixed = null
-
either an integer or an array of integers describing the folders which should be searched. If set to NULL the ID of the current item is used.
- $depth : mixed = true
-
the depth of searching children. Either an integer or true to get the values of all children
- $checkInheritance : bool = true
-
Whether inherited fields should be included into the search result or not. IMPORTANT: if this parameter is false, indexed searches are disabled and search is executed on Master DB level.
- $sortFields : mixed = array()
-
the fields the result should be sorted by, either as sql string or 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)
- $limit : string = ''
-
SQL limit condition in the form [Amount] or [Start],[Amount] as integers where [Start] is beginning with the index 0.
- $cacheTime : int
-
the time in minutes a search result may be cached to increase performance
- $bExtendedResult : bool = false
-
If true, this API method returns an object of type CSItemSearchResult containing more information than only a list of ids. For backward compatibility this defaults to false and returns a list of results only.
Tags
Return values
CSItemSearchResult|array<string|int, int> —An array of itemIDs matching the search with the given criteria if $bExtendedResult is false, otherwise an instance of CSItemSearchResult.
searchContentExtended()
This method handles searchSimpleContent method result paginated way.
public
searchContentExtended(CSItemSearchFilter $oItemSearchFilter[, string $sSearchKeyword = '*' ][, array<string|int, mixed> $aAttrIDs = null ][, array<string|int, mixed> $aRootIDs = null ][, mixed $iDepth = true ][, bool $bCheckInheritance = true ][, int $iSearchMode = CS_SEARCH_GOOGLE_LIKE ][, array<string|int, mixed> $aSortFields = array() ], int $iCacheTime) : CSItemSearchResult
Parameters
- $oItemSearchFilter : CSItemSearchFilter
-
any search request in the form of CSItemSearchFilter object, pagination parameters can be added with this object
- $sSearchKeyword : string = '*'
-
the content which must be found. If it is set to '*' everything matching the other criteria (rootIDs, SqlFilter ...) is returned.
- $aAttrIDs : array<string|int, mixed> = null
-
either null to search all simple searchable 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.
- $aRootIDs : array<string|int, mixed> = null
-
either an integer or an array of integers describing the folders which should be searched. If set to NULL the ID of the current item is used.
- $iDepth : mixed = true
-
the depth of searching children. Either an integer or true to get the values of all children
- $bCheckInheritance : 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.
- $iSearchMode : int = CS_SEARCH_GOOGLE_LIKE
-
a CS_SEARCH_ constant (CS_SEARCH_WITH_AND, CS_SEARCH_WITH_OR, CS_SEARCH_EXACT_PHRASE, CS_SEARCH_GOOGLE_LIKE)
- $aSortFields : array<string|int, mixed> = array()
-
the fields the result should be sorted by, either as sql string or 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)
- $iCacheTime : int
-
the time in minutes a search result may be cached to increase performance
Tags
Return values
CSItemSearchResult —returns count, results and page in the CSItemSearchResult object
searchSimpleContent()
Searches all items matching a given search criteria
public
searchSimpleContent(string $find[, mixed $attrIDs = null ][, mixed $rootIDs = null ][, mixed $depth = true ][, bool $checkInheritance = true ][, int $searchMode = CS_SEARCH_GOOGLE_LIKE ][, mixed $sortFields = array() ][, string $limit = '' ][, string|CSItemSearchFilter $itemFilter = '' ], int $cacheTime[, bool $bExtendedResult = false ]) : CSItemSearchResult|array<string|int, int>
Parameters
- $find : string
-
the content which must be found. If it is set to '*' everything matching the other criteria (rootIDs, SqlFilter ...) is returned.
- $attrIDs : mixed = null
-
either null to search all simple searchable 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 = null
-
either an integer or an array of integers describing the folders which should be searched. If set to NULL the ID of the current item is used.
- $depth : mixed = true
-
the depth of searching children. Either an integer or true to get the values of all children
- $checkInheritance : bool = true
-
Whether inherited fields should be included into the search result or not. IMPORTANT: if this parameter is false, indexed searches are disabled and search is executed on Master DB level.
- $searchMode : int = CS_SEARCH_GOOGLE_LIKE
-
a CS_SEARCH_ constant (CS_SEARCH_WITH_AND, CS_SEARCH_WITH_OR, CS_SEARCH_EXACT_PHRASE, CS_SEARCH_GOOGLE_LIKE)
- $sortFields : mixed = array()
-
the fields the result should be sorted by, either as sql string or 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)
- $limit : string = ''
-
SQL limit condition in the form [Amount] or [Start],[Amount] as integers where [Start] is beginning with the index 0.
- $itemFilter : string|CSItemSearchFilter = ''
-
an additional sql-filter which should be applied to the database queries
- $cacheTime : int
-
the time in minutes a search result may be cached to increase performance
- $bExtendedResult : bool = false
-
If true, this API method returns an object of type CSItemSearchResult containing more information than only a list of ids. For backward compatibility this defaults to false and returns a list of results only.
Tags
Return values
CSItemSearchResult|array<string|int, int> —An array of itemIDs matching the search with the given criteria if $bExtendedResult is false, otherwise an instance of CSItemSearchResult.
setAccessLevels()
Sets the access levels for this item
public
setAccessLevels(array<string|int, mixed> $rubricIDs) : void
Parameters
- $rubricIDs : array<string|int, mixed>
-
an array containing all new RubricIDs
Tags
Return values
void —setConfiguration()
Sets the configuration id for the current item
public
setConfiguration(int|string|Itemconfiguration $mConfiguration) : void
Parameters
- $mConfiguration : int|string|Itemconfiguration
-
The configuration id or the configuration object that should be applied to this item.
Tags
Return values
void —setConfigurationClassIds()
Sets the configuration class ids
public
setConfigurationClassIds(array<string|int, mixed> $aClassIds) : void
Parameters
- $aClassIds : array<string|int, mixed>
-
An array with configuration class or folder ids.
Tags
Return values
void —setDefaultLanguageID()
Changes the default language to the given language for the current session and therefore for all items.
public
setDefaultLanguageID(int $languageID[, bool $storePermanently = true ]) : mixed
This affects all language dependant methods (e.g. setValue, getValue) and Guis
Parameters
- $languageID : int
-
the requested languageID of the identifier or null if the current default language should be used
- $storePermanently : bool = true
-
whether the change should be stored in the session (true) or only for the current request (false)
Tags
Return values
mixed —setExternalKey()
Sets the external key of the item
public
setExternalKey(string $externalKey) : void
Parameters
- $externalKey : string
-
the new external key of the item
Tags
Return values
void —setFieldStateID()
Sets the Workflow State for a given field
public
setFieldStateID(int $configurationID, int $stateID[, int $languageID = null ], int $subType) : int
Parameters
- $configurationID : int
-
the field for which the State is set
- $stateID : int
-
the new StateID
- $languageID : int = null
-
the language for which the State is set
- $subType : int
-
this parameter can define the optional subtype of the value
Tags
Return values
int —the StateID of the Workflow
setFileContent()
Sets a new file content to the MamFile.
public
setFileContent(string $sFileContent[, string $sNewFileType = null ][, string $sLocalFilePath = null ][, CSFileStream $oStreamFile = null ]) : bool
To be able to do this, the file has to been checked out first.
Parameters
- $sFileContent : string
-
the new filecontent as a string.
- $sNewFileType : string = null
-
the new filetype
- $sLocalFilePath : string = null
-
the path of a local file (e.g. a uploaded file) which should be used instead of the $fileContent
- $oStreamFile : CSFileStream = null
-
The stream file API object.
Tags
Return values
bool —whether the content could be modified
setFileName()
Renames the CSMamFile
public
setFileName(string $newName) : mixed
Parameters
- $newName : string
-
the new FileName of CSMamFile
Tags
Return values
mixed —setFormattedValue()
Sets a formatted value of an item
public
setFormattedValue(int|string $mIdentifier, mixed $mValue[, int|null $iLanguageId = null ][, string $mMedium = '' ][, int $iContextId = null ]) : void
If you pass the label of the field as identifier be aware that labels are not unique and the value of the first field with that label will be returned.
Parameters
- $mIdentifier : int|string
-
Field ID or field name of the value to get.
- $mValue : mixed
-
The new formatted value to set (usually as string).
- $iLanguageId : int|null = null
-
The requested languageID of the identifier or null if the current default language should be used.
- $mMedium : string = ''
-
An alternative medium the value should be formatted for ( CSItemMedium::HTML or CSItemMedium::TEXT are supported as standard). This parameter is passed to the CSTypes getValue() method.
- $iContextId : int = null
-
The context id for which the value should be set
Tags
Return values
void —setGrid()
Allows to set a CSGridItem as value to a field
public
setGrid(string $iIdentifier, CSGrid $oGrid[, int $iLanguageID = NULL ], int $iSubType) : void
Parameters
- $iIdentifier : string
-
Field ID or field label of the value to set
- $oGrid : CSGrid
-
The object to set
- $iLanguageID : int = NULL
-
The requested languageID of the identifier or null if the current default language should be used
- $iSubType : int
-
The fields subtype
Tags
Return values
void —setKeyword()
Adds a keyword to the current item
public
setKeyword(mixed $keyword) : mixed
Parameters
- $keyword : mixed
-
keyword ID or CSKeyword object containing the keywords
Tags
Return values
mixed —setKeywords()
Sets the keywords for the current item
public
setKeywords(array<string|int, mixed> $keywordIDs) : mixed
Parameters
- $keywordIDs : array<string|int, mixed>
-
an array of keyword IDs or CSKeyword objects containing the keywords
Tags
Return values
mixed —setLabel()
Sets the label of the item
public
setLabel(string $label) : void
Parameters
- $label : string
-
the new label of the item
Tags
Return values
void —setOmittingVersionFile()
this method allows it to temporary disable the version file creation.
public
setOmittingVersionFile([bool $bOmit = true ]) : bool
This prevents undo checkout operations from restoring the file content but can save a lot of performance on file share based environments. Should only be used if no revert of files is necessary.
Parameters
- $bOmit : bool = true
-
if true, no version files are created, otherwise the default behavior is restored
Tags
Return values
bool —the previous state of version file creation
setReferences()
Sets the references for an attribute
public
setReferences(int $attrID[, array<string|int, mixed> $refIDs = array() ][, array<string|int, mixed> $removedRefIDs = array() ][, int $languageID = null ][, array<string|int, mixed> $additionalParams = array() ], mixed $iContextId) : void
Parameters
- $attrID : int
-
the id of the attribute which contains the references
- $refIDs : array<string|int, mixed> = array()
-
the array containing the ids of the new references
- $removedRefIDs : array<string|int, mixed> = array()
-
the array containing the ids of the references which should be removed from inherited values if additive inheritance is active
- $languageID : int = null
-
the optional languageID
- $additionalParams : array<string|int, mixed> = array()
-
additional values in the form key=>value which might be the standard keys like 'Type' or userdefined values
- $iContextId : mixed
Tags
Return values
void —setReferencesValues()
Associates multiple additional values with the references for an attribute of an item.
public
setReferencesValues(mixed $mRefSourceAttr[, array<string|int, mixed> $aasReferencesValues = array() ][, int $iLanguageId = NULL ]) : bool
Parameters
- $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.
- $aasReferencesValues : array<string|int, mixed> = array()
-
array A two-dimensional array containing the reference attribute values, grouped by the target item IDs (first dimension's key) and the reference attribute IDs/labels (second dimension's key). Non-existent target item IDs will be ignored. Upon storing the values, they will be implicitly typecasted into a string.
- $iLanguageId : int = NULL
-
The language of the references.
Tags
Return values
bool —TRUE on success or FALSE if the new reference attribute values could not be set.
setReferenceValue()
Associates a single value with a specific reference for an attribute of an item.
public
setReferenceValue(mixed $mRefSourceAttr, int $iRefTargetItemId, mixed $mRefAttrKey, string $sReferenceValue[, int $iLanguageId = NULL ]) : bool
Parameters
- $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
-
If the target item ID does not exist, the call will silently succeed without setting any value. If a second or third target with the given ID is existing, it may be accessed using a suffix _[COUNTER], e.g. 11, 11_2, 11_3, ...
- $mRefAttrKey : mixed
-
A string or int containing the ID/label of the reference's attribute which shall be written.
- $sReferenceValue : string
-
The reference attribute value. Upon storing the values, they will be implicitly typecasted into a string.
- $iLanguageId : int = NULL
-
The language of the references.
Tags
Return values
bool —TRUE on success or FALSE if the new reference attribute values could not be set.
setReferenceValues()
Associates multiple additional values with a specific reference for an attribute of an item.
public
setReferenceValues(mixed $mRefSourceAttr, int $iRefTargetItemId[, array<string|int, mixed> $asReferenceValues = array() ][, int $iLanguageId = NULL ]) : bool
Parameters
- $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
-
If the target item ID does not exist, the call will silently succeed without setting any value. If a second or third target with the given ID is existing, it may be accessed using a suffix _[COUNTER], e.g. 11, 11_2, 11_3, ...
- $asReferenceValues : array<string|int, mixed> = array()
-
array An array containing the reference attribute values, indexed by the reference attribute IDs/labels. Upon storing the values, they will be implicitly typecasted into a string.
- $iLanguageId : int = NULL
-
The language of the references.
Tags
Return values
bool —TRUE on success or FALSE if the new reference attribute values could not be set.
setValue()
Sets a value of an item
public
setValue(string $mIdentifier, string $mValue[, int|null $iLanguageId = null ], int $iSubType[, int $iContextId = null ]) : void
If you pass the label of the field as identifier be aware that labels are not unique and the value of the first field with that label will be set.
Parameters
- $mIdentifier : string
-
Field name or ID of the value to set
- $mValue : string
-
Value to set
- $iLanguageId : int|null = null
-
The languageID of the identifier or null if the current default language should be used
- $iSubType : int
-
The subType of a value, if a configuration has multiple attributes
- $iContextId : int = null
-
The context id for which the value should be set
Tags
Return values
void —setValueForConfig()
Sets a value on the item matching the setter definition.
public
setValueForConfig(CSItemValueSetter $oSetter) : void
Parameters
- $oSetter : CSItemValueSetter
-
The definition of the value to set.
Tags
Return values
void —setValues()
This method is designed to update multiple values for multiple Items.
public
setValues(array<string|int, mixed> $aValues[, int $iLanguageID = NULL ][, bool $bLoadIDFromExternalKey = FALSE ][, bool $bDoPreflight = TRUE ][, bool $bAllowInheritance = TRUE ][, bool $bIgnoreWhitespaces = TRUE ]) : bool
The array should look like the following (basically like an array returned by ):
array(
[ItemID1 / ExternalKey1] => array(
[ConfigurationID1] => [Value1],
[ConfigurationID2] => [Value2],
...
),
[ItemID2 / ExternalKey2] => array(
[ConfigurationID1] => [Value1],
[ConfigurationID3] => [Value3],
...
),
...
)
You can also pass an array of ConfigurationIDs/Value pairs to update only the current Item
Parameters
- $aValues : array<string|int, mixed>
-
An array containing the values to be updated
- $iLanguageID : int = NULL
-
The language id which should be updated as integer
- $bLoadIDFromExternalKey : bool = FALSE
-
Whether the value updates are searching for ExternalKeys instead of item ids
- $bDoPreflight : bool = TRUE
-
If set to FALSE all values will be set wether they have changed or not (CAUTION: disabling the preflight option costs Performance!!!)
- $bAllowInheritance : bool = TRUE
-
Whether the result from the parent node should be returned if no value is found for an item
- $bIgnoreWhitespaces : bool = TRUE
-
If set to TRUE the whitespaces will be trimmed for compare (only applies if $bDoPreflight is TRUE)
Tags
Return values
bool —setValuesForConfig()
Sets values on the item matching the setter definition.
public
setValuesForConfig(CSItemValuesSetter $oSetter) : void
Parameters
- $oSetter : CSItemValuesSetter
-
The definition of the values to set.
Tags
Return values
void —store()
Stores an item to the database and returns the ID of the item
public
store() : int
Tags
Return values
int —the ID of the item
synchronize()
Synchronizes all files within the current folder Sometimes a extended synchronisation is required, e.g. when the local version files have been deleted, e.g. by installing a backup on a other system. For this reason the $forceCompleteCheck flag has been added.
public
synchronize([bool $forceCompleteCheck = false ]) : array<string|int, mixed>
If this flag is set the details of all files are transfered. Therefore this action may require a long time to synchronize
Parameters
- $forceCompleteCheck : bool = false
-
whether all files should be explicitly compared or only the changed ones
Tags
Return values
array<string|int, mixed> —of arrays containing the changed ids, with a group as key (new, created, deleted, changed, syncstatechanged) and the related ids as values
toXml()
Returns an xml content with the item and it's children
public
toXml(int $levels[, string $xsl = '' ][, mixed $additionalOptions = array() ]) : array<string|int, mixed>
Parameters
- $levels : int
-
depth of the xml hierarchy
- $xsl : string = ''
-
xsl-file to transform 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
undoCheckout()
Do an undo checkout to the current item
public
undoCheckout([bool $recursive = false ]) : bool
Parameters
- $recursive : bool = false
-
whether the undo checkout has to affect all childrens
Tags
Return values
bool —whether undoCheckout succeeded or not
unlink()
Replaces a link with a copy of the original file
public
unlink() : bool
Tags
Return values
bool —whether the unlink succeeded
unlock()
unlocks a file previously locked by the lock-method
public
unlock() : int
Tags
Return values
int —the user id the file has been locked for previously
unzip()
Extracts files from the Mamfile, if it is a zip.
public
unzip([CSMamFile $dstFolder = null ][, array<string|int, mixed> $copyAttributes = array() ][, bool $overwrite = false ][, array<string|int, mixed> $aForbiddenFileTypes = array() ][, bool $bCreateDuplicateForExistingFiles = false ][, bool $bReturnDetailInformation = false ]) : array<string|int, CSMamFile>
Parameters
- $dstFolder : CSMamFile = null
-
The optional folder where the contained files should be unzipped to
- $copyAttributes : array<string|int, mixed> = array()
-
The attributeIDs which should be copied from the zip file to the extracted files. If it is null no attributes are copied and if it is an empty array all attributes are copied.
- $overwrite : bool = false
-
If TRUE, files are getting overwritten, otherwise not.
- $aForbiddenFileTypes : array<string|int, mixed> = array()
-
An array of file types that should not be extracted and added to the MAM.
- $bCreateDuplicateForExistingFiles : bool = false
-
If set to TRUE duplicates are created.
- $bReturnDetailInformation : bool = false
-
If set to TRUE an array with detail information is returned. For example: if file was duplicates/overwritten/exists ...
Tags
Return values
array<string|int, CSMamFile> —An array of the CSMamFile objects of all extracted files.
unzipFiles()
Extracts only files (without folder structure) from the MamFile, if it is a zip.
public
unzipFiles([CSMamFile $dstFolder = null ][, array<string|int, mixed> $copyAttributes = array() ][, bool $overwrite = false ][, array<string|int, mixed> $aForbiddenFileTypes = array() ][, bool $bCreateDuplicateForExistingFiles = false ][, bool $bReturnDetailInformation = false ]) : array<string|int, CSMamFile>
Parameters
- $dstFolder : CSMamFile = null
-
The optional folder where the contained files should be unzipped to
- $copyAttributes : array<string|int, mixed> = array()
-
The attributeIDs which should be copied from the zip file to the extracted files. If it is null no attributes are copied and if it is an empty array all attributes are copied.
- $overwrite : bool = false
-
If TRUE, files are getting overwritten, otherwise not.
- $aForbiddenFileTypes : array<string|int, mixed> = array()
-
An array of file types that should not be extracted and added to the MAM.
- $bCreateDuplicateForExistingFiles : bool = false
-
If set to TRUE duplicates are created.
- $bReturnDetailInformation : bool = false
-
If set to TRUE an array with detail information is returned. For example: if file was duplicates/overwritten/exists ...
Tags
Return values
array<string|int, CSMamFile> —An array of the CSMamFile objects of all extracted files.
