CSCometItemApiReference
extends CSItemApiReference
in package
Class CSCometItemApiReference* Defines a special CSItemApiReference to the comet items
Note: Since CS16.1 all methods with 'product' were deleted use the corresponding method with 'item' in name.
Tags
Table of Contents
- delete() : bool
- Deletes the reference connection (but not the referenced object itself)
- getFormattedItemTextValues() : array<string|int, mixed>
- Returns a list of formatted attributes for the referenced item, which can be used to build a details text for the item, e.g. in a sketch preview representation. The attributes that will appear in the list can be configured in the PPM Comet Connector's administration settings (to be found in the CS options).
- 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.
- getGrossArea() : float
- Returns the gross area (in square millimeters) that the rendered Comet template will cover for a specific referenced product.
- getGroup() : int
- Returns the comet group id this product is referenced by in the current document
- getHeight() : float
- Returns the height
- getID() : string|int
- Returns the ID for the reference connection
- getList() : CSItemApiReferenceList
- Returns the CSItemApiReferenceList the References are belonging to.
- getNetArea() : float
- Returns the net area (in square millimeters) that the rendered Comet template will cover for a specific referenced product.
- getNotes() : string
- Returns the notes
- getPage() : mixed
- Returns the page index where a specific referenced product has been placed.
- getPosition() : int|false
- Returns the position (index) of the reference in its ReferenceList
- getPositionLeft() : float
- Returns the left position
- getPositionTop() : float
- Returns the top position
- getShare() : int
- Returns the share id for a specific referenced product.
- getSourceItem() : CSItemApiItem
- Returns the source of the References.
- getState() : int
- Returns the placement state for a specific referenced product.
- 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.
- getTemplate() : mixed
- Returns the Comet product template that is assigned to a referenced product.
- 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.
- getWidth() : float
- Returns the width
- getZLevel() : int
- Returns the z-index of the product reference
- hasPosition() : bool
- Determines whether a page position is assigned to the product reference or not.
- isInherited() : bool
- Checks if this reference is inherited form parent.
- setCometItemValues() : bool
- Sets multiple values for referenced item at once. Values set to NULL will remain untouched.
- setGrossArea() : bool
- Sets the gross area (in square millimeters) that should be reported for the rendered Comet template of a specific referenced product.
- setGroup() : bool
- Sets the comet group id this product is referenced by in the current document
- setHeight() : bool
- Sets the height
- setItemValuesForPlacedList() : bool
- Sets multiple values for Placed List at once. Values set to NULL will remain untouched.
- setItemValuesForPlannedList() : bool
- Sets multiple values for Planned List at once. Values set to NULL will remain untouched.
- setNetArea() : bool
- Sets the net area (in square millimeters) that should be reported for the rendered Comet template of a specific referenced product.
- setNotes() : bool
- Sets the notes
- setPage() : bool
- Sets the page index where a specific referenced product is meant to be placed. Please note that setting this value does NOT actually move the product to another page within the document but only changes the informative value for the reference attribute.
- setPosition() : int
- Changes the position of the reference in its ReferenceList.
- setPositionLeft() : bool
- Sets the left position
- setPositionTop() : bool
- Sets the top position
- setShare() : bool
- Sets the share id for a specific referenced product.
- setTarget() : bool
- Changes the target object of the reference in its ReferenceList.
- setTemplate() : bool
- Assigns a Comet product template to a referenced product.
- 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.
- setWidth() : bool
- Sets the width
- setZLevel() : bool
- Sets the z-index of a product reference
Methods
delete()
Deletes the reference connection (but not the referenced object itself)
public
delete() : bool
Tags
Return values
bool —getFormattedItemTextValues()
Returns a list of formatted attributes for the referenced item, which can be used to build a details text for the item, e.g. in a sketch preview representation. The attributes that will appear in the list can be configured in the PPM Comet Connector's administration settings (to be found in the CS options).
public
getFormattedItemTextValues() : array<string|int, mixed>
Tags
Return values
array<string|int, mixed> —An indexed array of attribute values for the referenced item, where the attribute IDs are used as the keys.
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.
getGrossArea()
Returns the gross area (in square millimeters) that the rendered Comet template will cover for a specific referenced product.
public
getGrossArea() : float
"Gross area" means the area covered by the entire product template including whitespace (WIDTH*HEIGHT of the template's bounding box).
Tags
Return values
float —The gross area in square millimeters. If the given product has not yet been placed in the document, the covered area will be zero sqmm (no area is covered).
getGroup()
Returns the comet group id this product is referenced by in the current document
public
getGroup() : int
Tags
Return values
int —the comet group id for this product
getHeight()
Returns the height
public
getHeight() : float
Tags
Return values
float —the height (in screen millimeters)
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
getNetArea()
Returns the net area (in square millimeters) that the rendered Comet template will cover for a specific referenced product.
public
getNetArea() : float
"Net area" means the sum of all areas covered by stand-alone frames (a.k.a. placeholders) or grouped frames including whitespace (WIDTH*HEIGHT of the frame's/group's bounding box).
Tags
Return values
float —The net area in square millimeters. If the given product has not yet been placed in the document, the covered area will be zero sqmm (no area is covered).
getNotes()
Returns the notes
public
getNotes() : string
Tags
Return values
string —the notes
getPage()
Returns the page index where a specific referenced product has been placed.
public
getPage() : mixed
Tags
Return values
mixed —The page index where the referenced product is currently placed (a positive integer >=0) or CSComet::TEMPLATE_PAGE_UNASSIGNED if the referenced product is not yet placed on any page. Be aware that you should use typed comparison (e.g. "===") when testing againgst the constant value.
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.
getPositionLeft()
Returns the left position
public
getPositionLeft() : float
Tags
Return values
float —the left position (in screen millimeters)
getPositionTop()
Returns the top position
public
getPositionTop() : float
Tags
Return values
float —the top position (in screen millimeters)
getShare()
Returns the share id for a specific referenced product.
public
getShare() : int
Tags
Return values
int —The comet share id of the reference
getSourceItem()
Returns the source of the References.
public
getSourceItem() : CSItemApiItem
Tags
Return values
CSItemApiItem —The source
getState()
Returns the placement state for a specific referenced product.
public
getState() : int
Tags
Return values
int —The current placement status of the referenced product (one of the CSComet::PLACESTATE_* constants for the "PdmArticle" item class). If the product placement state has never been set before, the first valid "PdmArticle" placement state is returned.
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
getTemplate()
Returns the Comet product template that is assigned to a referenced product.
public
getTemplate() : mixed
Tags
Return values
mixed —The ID of the Comet product template currently assigned to the referenced product or CSComet::TEMPLATE_SOURCE_INHERIT if the template should be inherited from another location (e.g. from the referenced product instead if the reference itself). Be aware that you should use typed comparison (e.g. "===") when testing againgst the constant value.
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.
getWidth()
Returns the width
public
getWidth() : float
Tags
Return values
float —the width (in screen millimeters)
getZLevel()
Returns the z-index of the product reference
public
getZLevel() : int
Tags
Return values
int —the z-index
hasPosition()
Determines whether a page position is assigned to the product reference or not.
public
hasPosition() : bool
Tags
Return values
bool —TRUE, if both the left and top position are defined for the product reference, FALSE otherwise.
isInherited()
Checks if this reference is inherited form parent.
public
isInherited() : bool
Tags
Return values
bool —setCometItemValues()
Sets multiple values for referenced item at once. Values set to NULL will remain untouched.
public
setCometItemValues([int $iPlacementState = null ][, mixed $mCometItemTemplateId = null ][, int $iCometGroupID = null ][, float $fNetArea = null ][, float $fGrossArea = null ][, mixed $mPageIndex = null ][, int $iShareID = null ]) : bool
Parameters
- $iPlacementState : int = null
-
The new placement state to set. This should be one of the CSComet::PLACESTATE_* constants that are valid for item class.
- $mCometItemTemplateId : mixed = null
-
The unique Comet product template ID or the CSComet::TEMPLATE_SOURCE_INHERIT constant (see ).
- $iCometGroupID : int = null
-
The optional groupID in the Indesign document
- $fNetArea : float = null
-
The net area in square millimeters that should be reported when querying the value via .
- $fGrossArea : float = null
-
The gross area in square millimeters that should be reported when querying the value via .
- $mPageIndex : mixed = null
-
The new page index to set (a positive integer >=0) or CSComet::TEMPLATE_PAGE_UNASSIGNED.
- $iShareID : int = null
-
The CometShare ID.
Tags
Return values
bool —TRUE on success or FALSE if the new reference attribute values could not be set.
setGrossArea()
Sets the gross area (in square millimeters) that should be reported for the rendered Comet template of a specific referenced product.
public
setGrossArea(float $fGrossArea) : bool
"Gross area" means the area covered by the entire product template including whitespace (WIDTH*HEIGHT of the template's bounding box). Please note that setting this value does NOT actually resize the product template within the document but only changes the informative value for the reference attribute.
Parameters
- $fGrossArea : float
-
The gross area in square millimeters that should be reported when querying the value via .
Tags
Return values
bool —TRUE on success or FALSE if the new gross area could not be set.
setGroup()
Sets the comet group id this product is referenced by in the current document
public
setGroup(int $iGroupID) : bool
Parameters
- $iGroupID : int
-
the comet group id
Tags
Return values
bool —TRUE on success or FALSE if the new comet group could not be set.
setHeight()
Sets the height
public
setHeight(float $fHeight) : bool
Parameters
- $fHeight : float
-
the height (in screen millimeters)
Tags
Return values
bool —TRUE on success or FALSE if the top position could not be set.
setItemValuesForPlacedList()
Sets multiple values for Placed List at once. Values set to NULL will remain untouched.
public
setItemValuesForPlacedList([mixed $mCometItemTemplateId = null ][, int $iCometGroupID = null ][, float $fNetArea = null ][, float $fGrossArea = null ][, mixed $mPageIndex = null ][, int $iShareID = null ][, float $fPositionLeft = null ][, float $fPositionTop = null ][, float $fWidth = null ][, float $fHeight = null ]) : bool
Parameters
- $mCometItemTemplateId : mixed = null
-
The unique Comet product template ID or the CSComet::TEMPLATE_SOURCE_INHERIT constant (see ).
- $iCometGroupID : int = null
-
The optional groupID in the Indesign document
- $fNetArea : float = null
-
The net area in square millimeters that should be reported when querying the value via .
- $fGrossArea : float = null
-
The gross area in square millimeters that should be reported when querying the value via .
- $mPageIndex : mixed = null
-
The new page index to set (a positive integer >=0) or CSComet::TEMPLATE_PAGE_UNASSIGNED.
- $iShareID : int = null
-
The CometShare ID.
- $fPositionLeft : float = null
-
The left position
- $fPositionTop : float = null
-
The top position
- $fWidth : float = null
-
Width
- $fHeight : float = null
-
Height
Tags
Return values
bool —TRUE on success or FALSE if the new reference attribute values could not be set.
setItemValuesForPlannedList()
Sets multiple values for Planned List at once. Values set to NULL will remain untouched.
public
setItemValuesForPlannedList([mixed $mCometItemTemplateId = null ][, int $iCometGroupID = null ][, float $fGrossArea = null ][, mixed $mPageIndex = null ][, int $iShareID = null ][, float $fPositionLeft = null ][, float $fPositionTop = null ][, float $fWidth = null ][, float $fHeight = null ][, string $sNotes = null ][, string $zLevel = null ]) : bool
Parameters
- $mCometItemTemplateId : mixed = null
-
The unique Comet product template ID or the CSComet::TEMPLATE_SOURCE_INHERIT constant (see ).
- $iCometGroupID : int = null
-
The optional groupID in the Indesign document
- $fGrossArea : float = null
-
The gross area in square millimeters that should be reported when querying the value via .
- $mPageIndex : mixed = null
-
The new page index to set (a positive integer >=0) or CSComet::TEMPLATE_PAGE_UNASSIGNED.
- $iShareID : int = null
-
Share ID
- $fPositionLeft : float = null
-
The left position
- $fPositionTop : float = null
-
The top position
- $fWidth : float = null
-
Width
- $fHeight : float = null
-
Height
- $sNotes : string = null
-
Notes
- $zLevel : string = null
-
Z Level
Tags
Return values
bool —TRUE on success or FALSE if the new reference attribute values could not be set.
setNetArea()
Sets the net area (in square millimeters) that should be reported for the rendered Comet template of a specific referenced product.
public
setNetArea(float $fNetArea) : bool
"Net area" means the sum of all areas covered by stand-alone frames (a.k.a. placeholders) or grouped frames including whitespace (WIDTH*HEIGHT of the frame's/group's bounding box). Please note that setting this value does NOT actually resize the product template within the document but only changes the informative value for the reference attribute.
Parameters
- $fNetArea : float
-
The net area in square millimeters that should be reported when querying the value via .
Tags
Return values
bool —TRUE on success or FALSE if the new net area could not be set.
setNotes()
Sets the notes
public
setNotes(string $sNotes) : bool
Parameters
- $sNotes : string
-
the notes
Tags
Return values
bool —TRUE on success or FALSE if the notes could not be set.
setPage()
Sets the page index where a specific referenced product is meant to be placed. Please note that setting this value does NOT actually move the product to another page within the document but only changes the informative value for the reference attribute.
public
setPage([mixed $mPageIndex = CSComet::TEMPLATE_PAGE_UNASSIGNED ]) : bool
Parameters
- $mPageIndex : mixed = CSComet::TEMPLATE_PAGE_UNASSIGNED
-
The new page index to set (a positive integer >=0) or CSComet::TEMPLATE_PAGE_UNASSIGNED.
Tags
Return values
bool —TRUE on success or FALSE if the new page index could not be set.
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
setPositionLeft()
Sets the left position
public
setPositionLeft(float $fPositionLeft) : bool
Parameters
- $fPositionLeft : float
-
the left position (in screen millimeters)
Tags
Return values
bool —TRUE on success or FALSE if the left position could not be set.
setPositionTop()
Sets the top position
public
setPositionTop(float $fPositionTop) : bool
Parameters
- $fPositionTop : float
-
the top position (in screen millimeters)
Tags
Return values
bool —TRUE on success or FALSE if the top position could not be set.
setShare()
Sets the share id for a specific referenced product.
public
setShare(int $iShareID) : bool
Parameters
- $iShareID : int
-
The new share id to set.
Tags
Return values
bool —TRUE on success or FALSE if the new share id could not be set.
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.
setTemplate()
Assigns a Comet product template to a referenced product.
public
setTemplate([mixed $mCometItemTemplateId = CSComet::TEMPLATE_SOURCE_INHERIT ]) : bool
Parameters
- $mCometItemTemplateId : mixed = CSComet::TEMPLATE_SOURCE_INHERIT
-
The unique Comet product template ID or the CSComet::TEMPLATE_SOURCE_INHERIT constant. Inheriting the product template means that the product template to use during placement actions will be determined from the referenced product instead from the reference itself.
Tags
Return values
bool —TRUE on success or FALSE if the new template could not be assigned.
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.
setWidth()
Sets the width
public
setWidth(float $fWidth) : bool
Parameters
- $fWidth : float
-
the width (in screen millimeters)
Tags
Return values
bool —TRUE on success or FALSE if the top position could not be set.
setZLevel()
Sets the z-index of a product reference
public
setZLevel(string|int $zLevel) : bool
Parameters
- $zLevel : string|int
