CSItemApiField
in package
Defines a field that a item or view may have
Tags
Table of Contents
- $field : Itemconfiguration
- __clone() : mixed
- __construct() : mixed
- addField() : void
- Adds an Attribute (=Field) to this class (=Folder of Fields) Note that the class must be stored before the new field becomes available.
- copy() : CSItemApiField
- Copies an existing field
- delete() : void
- Deletes a field
- getAllowedClassIDs() : array<string|int, mixed>
- Returns the IDs of all allowed classes within this class
- getAllowedWorkflowIDs() : array<string|int, mixed>
- Returns the IDs of all allowed workflows within this class
- getChildren() : array<string|int, mixed>
- Returns an array with the children of a field
- getCSType() : CSType
- Gets the CSType object for the field
- getDescription() : string
- Returns the description of the field
- getField() : Itemconfiguration
- Returns the $field record object
- getFieldIDs() : array<string|int, mixed>
- Returns the IDs of all Attributes which are selected by this class
- getGuiField() : CSGuiField
- Gets the CSGuiField object for the current CSType
- getGuiSortOrder() : int
- Returns the GUI sort order of the field.
- getID() : int
- Returns the ID of the field
- getLabel() : string
- Return the label of the field
- getListFilter() : CSListFilter
- Returns the CSListFilter object, which contains filter values for given attributes.
- getName() : string
- Return the name of the field
- getPaneTitle() : string
- Returns the pane title of the field. All sorting and other groupings are removed and the value is translated.
- getParent() : CSPmsField
- Returns the parent of a field
- getPath() : array<string|int, mixed>
- Returns an array with the ancestors of an item
- getSectionTitle() : string
- Returns the section title of the field. All sorting and other groupings are removed and the value is translated.
- getType() : string
- Gets the type of a field
- getValue() : string
- Gets a value of a field parameter
- isEditable() : bool
- Returns whether the current user has the rights to be able edit the field in the editor
- isInherited() : bool
- Whether the field's value may be inherited from the ancestor items
- isLanguageDependant() : bool
- Whether the field has language dependant values
- isVisible() : bool
- Returns whether the current user has the rights to be able view the field
- move() : void
- Moves the field near to the target field
- removeField() : void
- Removes an Attribute (=Field) from this class (=Folder of Fields) Note that the class must be stored before the change becomes available.
- setGuiSortOrder() : void
- Sets the GUI sort order to the field.
- setInheritance() : bool
- Sets the inheritance flag of a field
- setLabel() : void
- Sets the label of the field
- setLanguageDependance() : void
- Sets the language dependance flag of a field
- setName() : void
- Sets the name of the field
- setType() : void
- Sets the type of the field
- setValue() : void
- Sets a value of a field parameter depending on the specific type the field has
- store() : int
- Stores an field to the database and returns the ID of the field
Properties
$field
public
Itemconfiguration
$field
Tags
Methods
__clone()
public
__clone() : mixed
Tags
Return values
mixed —__construct()
public
__construct(mixed $ID, mixed $itemApi) : mixed
Parameters
- $ID : mixed
- $itemApi : mixed
Tags
Return values
mixed —addField()
Adds an Attribute (=Field) to this class (=Folder of Fields) Note that the class must be stored before the new field becomes available.
public
addField(int $FieldID) : void
Parameters
- $FieldID : int
-
the ID of the Field that should be added to the class
Tags
Return values
void —copy()
Copies an existing field
public
copy(int $targetID[, int $position = CSITEM_POSITION_AFTER ]) : CSItemApiField
Parameters
- $targetID : int
-
ID of the targeted field
- $position : int = CSITEM_POSITION_AFTER
-
position relative to the target field
Tags
Return values
CSItemApiField —a CSItemApiField representing the new copy
delete()
Deletes a field
public
delete() : void
Tags
Return values
void —getAllowedClassIDs()
Returns the IDs of all allowed classes within this class
public
getAllowedClassIDs() : array<string|int, mixed>
Tags
Return values
array<string|int, mixed> —of classID which may be direct children of this class
getAllowedWorkflowIDs()
Returns the IDs of all allowed workflows within this class
public
getAllowedWorkflowIDs() : array<string|int, mixed>
Tags
Return values
array<string|int, mixed> —of WorkflowID which may be used within this class
getChildren()
Returns an array with the children of a field
public
getChildren(int $iLevels) : array<string|int, mixed>
Parameters
- $iLevels : int
-
depth of levels to descend to, if 0 all children are returned
Tags
Return values
array<string|int, mixed> —the children fields of the field
getCSType()
Gets the CSType object for the field
public
getCSType() : CSType
Tags
Return values
CSType —the cstype of the field
getDescription()
Returns the description of the field
public
getDescription() : string
Tags
Return values
string —description of the field
getField()
Returns the $field record object
public
getField() : Itemconfiguration
Tags
Return values
Itemconfiguration —the $field record object
getFieldIDs()
Returns the IDs of all Attributes which are selected by this class
public
getFieldIDs() : array<string|int, mixed>
Tags
Return values
array<string|int, mixed> —of CSItemApiFieldIDs contained by the selected class
getGuiField()
Gets the CSGuiField object for the current CSType
public
getGuiField(string $sName) : CSGuiField
Parameters
- $sName : string
-
The name of the GUI field.
Tags
Return values
CSGuiField —CSGuiField object
getGuiSortOrder()
Returns the GUI sort order of the field.
public
getGuiSortOrder() : int
Tags
Return values
int —with the GUI sort order of the field.
getID()
Returns the ID of the field
public
getID() : int
Tags
Return values
int —the ID of the field
getLabel()
Return the label of the field
public
getLabel([bool $bForEditor = true ], int $iLanguageId) : string
Parameters
- $bForEditor : bool = true
-
To get the translation for editor/list
- $iLanguageId : int
-
The language id to get translated label in that language
Tags
Return values
string —label of the field
getListFilter()
Returns the CSListFilter object, which contains filter values for given attributes.
public
getListFilter() : CSListFilter
Tags
Return values
CSListFilter —getName()
Return the name of the field
public
getName() : string
Tags
Return values
string —name of the field
getPaneTitle()
Returns the pane title of the field. All sorting and other groupings are removed and the value is translated.
public
getPaneTitle() : string
Tags
Return values
string —the pane title of the field
getParent()
Returns the parent of a field
public
getParent() : CSPmsField
Tags
Return values
CSPmsField —the parent of the field
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
getSectionTitle()
Returns the section title of the field. All sorting and other groupings are removed and the value is translated.
public
getSectionTitle() : string
Tags
Return values
string —the section title of the field
getType()
Gets the type of a field
public
getType() : string
Tags
Return values
string —name of the type
getValue()
Gets a value of a field parameter
public
getValue(string $name) : string
Parameters
- $name : string
-
name of the value to get
Tags
Return values
string —the value
isEditable()
Returns whether the current user has the rights to be able edit the field in the editor
public
isEditable(int $stateID[, int $iForItemType = Itemright::ITEM_TYPE_IGNORE ]) : bool
Parameters
- $stateID : int
-
the StateID of the Item for which the right should be checked (or 0 to check global right)
- $iForItemType : int = Itemright::ITEM_TYPE_IGNORE
-
Item type to use the correct Rights when they are specific for "folders" or "nodes"
Tags
Return values
bool —whether the field is editable or not
isInherited()
Whether the field's value may be inherited from the ancestor items
public
isInherited() : bool
Tags
Return values
bool —whether the field's value may be inherited from the ancestor items
isLanguageDependant()
Whether the field has language dependant values
public
isLanguageDependant() : bool
Tags
Return values
bool —whether the field has language dependant values
isVisible()
Returns whether the current user has the rights to be able view the field
public
isVisible(int $stateID) : bool
Parameters
- $stateID : int
-
the StateID of the Item for which the right should be checked (or 0 to check global right)
Tags
Return values
bool —whether the field is visible or not
move()
Moves the field near to the target field
public
move(int $targetID[, int $position = CSITEM_POSITION_AFTER ]) : void
Parameters
- $targetID : int
-
ID of the targeted field
- $position : int = CSITEM_POSITION_AFTER
-
position relative to the target field
Tags
Return values
void —removeField()
Removes an Attribute (=Field) from this class (=Folder of Fields) Note that the class must be stored before the change becomes available.
public
removeField(int $FieldID) : void
Parameters
- $FieldID : int
-
the ID of the Field that should be removed from the class
Tags
Return values
void —setGuiSortOrder()
Sets the GUI sort order to the field.
public
setGuiSortOrder(int $iGuiSortOrder) : void
Parameters
- $iGuiSortOrder : int
-
The GUI sort order which should be defined.
Tags
Return values
void —setInheritance()
Sets the inheritance flag of a field
public
setInheritance([bool $isInherited = true ]) : bool
Parameters
- $isInherited : bool = true
-
whether the field's value can be inherited from the ancestor items
Tags
Return values
bool —setLabel()
Sets the label of the field
public
setLabel(string $sLabel) : void
Parameters
- $sLabel : string
-
Label of the field
Tags
Return values
void —setLanguageDependance()
Sets the language dependance flag of a field
public
setLanguageDependance([bool $isLanguageDependant = true ]) : void
Parameters
- $isLanguageDependant : bool = true
-
whether the field can have language dependant values
Tags
Return values
void —setName()
Sets the name of the field
public
setName(string $sName) : void
Parameters
- $sName : string
-
Name of the field.
Tags
Return values
void —setType()
Sets the type of the field
public
setType(string $name[, string $module = 'core' ][, bool $loadFromProject = false ]) : void
Parameters
- $name : string
-
name of the type to set
- $module : string = 'core'
-
name of the module the type is defined in
- $loadFromProject : bool = false
-
set this flag if the type is defined in the project
Tags
Return values
void —setValue()
Sets a value of a field parameter depending on the specific type the field has
public
setValue(string $name, string $value) : void
Parameters
- $name : string
-
name of the value to set
- $value : string
-
value to set
Tags
Return values
void —store()
Stores an field to the database and returns the ID of the field
public
store() : int
Tags
Return values
int —the ID of the field
