CSItemApiReference
in package
Defines a reference between two items
Tags
Table of Contents
- delete() : bool
- Deletes the reference connection (but not the referenced object itself)
- getFormattedValue() : mixed|null
- Gets an additional formatted value from the reference connection.
- getFormattedValues() : array<string|int, mixed>
- Returns the additional values as formatted values that are associated with a specific reference for an attribute of an item.
- getID() : string|int
- Returns the ID for the reference connection
- getList() : CSItemApiReferenceList
- Returns the CSItemApiReferenceList the References are belonging to.
- getPosition() : int|false
- Returns the position (index) of the reference in its ReferenceList
- getSourceItem() : CSItemApiItem
- Returns the source of the References.
- getTargetClass() : string
- Returns the class name of the target item (like 'Pdmarticle' for Products or 'Pdmarticlestructure' for Views)
- getTargetID() : string
- Returns the ID of the Reference target.
- getTargetItem() : CSItemApiItem
- Returns the target the References are pointing to.
- getValue() : string
- Gets an additional value from the reference connection.
- getValues() : array<string|int, mixed>
- Returns the additional values that are associated with a specific reference for an attribute of an item.
- isInherited() : bool
- Checks if this reference is inherited form parent.
- setPosition() : int
- Changes the position of the reference in its ReferenceList.
- setTarget() : bool
- Changes the target object of the reference in its ReferenceList.
- setValue() : bool
- Sets an additional value to the reference connection.
- setValues() : bool
- Associates multiple additional values with a specific reference for an attribute of an item.
Methods
delete()
Deletes the reference connection (but not the referenced object itself)
public
delete() : bool
Tags
Return values
bool —getFormattedValue()
Gets an additional formatted value from the reference connection.
public
getFormattedValue(string|int $mRequestedAttrKey) : mixed|null
Parameters
- $mRequestedAttrKey : string|int
Tags
Return values
mixed|null —getFormattedValues()
Returns the additional values as formatted values that are associated with a specific reference for an attribute of an item.
public
getFormattedValues([mixed $mRequestedAttrKeys = null ][, bool $bShowInherited = true ]) : array<string|int, mixed>
Parameters
- $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.
Tags
Return values
array<string|int, mixed> —An array containing the reference attribute formatted values, indexed by the original $mRequestedAttrKeys.
getID()
Returns the ID for the reference connection
public
getID() : string|int
Tags
Return values
string|int —getList()
Returns the CSItemApiReferenceList the References are belonging to.
public
getList() : CSItemApiReferenceList
Tags
Return values
CSItemApiReferenceList —The list
getPosition()
Returns the position (index) of the reference in its ReferenceList
public
getPosition() : int|false
Tags
Return values
int|false —the position as integer beginning with 0 or false, if the element is no longer in the list.
getSourceItem()
Returns the source of the References.
public
getSourceItem() : CSItemApiItem
Tags
Return values
CSItemApiItem —The source
getTargetClass()
Returns the class name of the target item (like 'Pdmarticle' for Products or 'Pdmarticlestructure' for Views)
public
getTargetClass() : string
Tags
Return values
string —getTargetID()
Returns the ID of the Reference target.
public
getTargetID() : string
Tags
Return values
string —the ID of the References target
getTargetItem()
Returns the target the References are pointing to.
public
getTargetItem() : CSItemApiItem
Tags
Return values
CSItemApiItem —The target
getValue()
Gets an additional value from the reference connection.
public
getValue(string $mRequestedAttrKey) : string
Parameters
- $mRequestedAttrKey : string
-
the key of the reference value
Tags
Return values
string —the value of the reference value
getValues()
Returns the additional values that are associated with a specific reference for an attribute of an item.
public
getValues([mixed $mRequestedAttrKeys = null ][, bool $bShowInherited = true ]) : array<string|int, mixed>
Parameters
- $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.
Tags
Return values
array<string|int, mixed> —An array containing the reference attribute values, indexed by the original $mRequestedAttrKeys.
isInherited()
Checks if this reference is inherited form parent.
public
isInherited() : bool
Tags
Return values
bool —setPosition()
Changes the position of the reference in its ReferenceList.
public
setPosition(int $position) : int
Parameters
- $position : int
-
The new position as integer beginning with 0. If -1 or true is passed the element is moved to the end of the list. If false is passed, the element is positioned as first element. 0 or FALSE: insert as first element 1: insert as second, ...
Tags
Return values
int —the new position
setTarget()
Changes the target object of the reference in its ReferenceList.
public
setTarget(int|Item|CSItemApiItem $mTarget[, null|int|string|Item|CSItemApiItem $mTargetObjectOrClassName = null ]) : bool
Parameters
- $mTarget : int|Item|CSItemApiItem
-
The new target either as ID or as element where the ID is loaded using the getID() method and getClassID() method to determine the Class ID (TableInfo Class ID).
- $mTargetObjectOrClassName : null|int|string|Item|CSItemApiItem = null
-
The new corresponding to the given Target the item type in form of an object or object name or object (TableInfo) class id / real item ClassName like 'Pdmarticle' for Products.
Tags
Return values
bool —TRUE on success or FALSE if the new target could not be set.
setValue()
Sets an additional value to the reference connection.
public
setValue(string|int $mRequestedAttrKey, mixed $mRequestedAttrValue) : bool
Parameters
- $mRequestedAttrKey : string|int
-
The key of the reference value
- $mRequestedAttrValue : mixed
-
The new value of the reference value
Tags
Return values
bool —setValues()
Associates multiple additional values with a specific reference for an attribute of an item.
public
setValues([array<string|int, mixed> $asReferenceValues = array() ]) : bool
Parameters
- $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 typecast into a string.
Tags
Return values
bool —TRUE on success or FALSE if the new reference attribute values could not be set.
