Class \Scrivo\ListItemPropertyDefinition
Class to hold the property definitions for list item properties.
It holds the information to propery instantiate a list item property.
These properties are all derived from the ListItemProperty the class. The latter accounts for the persistent storage of the actual property data. But when an list item property is instantiated it should be in the form of a 'typed' list item property (such as image, url). The list item property defintion determines the type property and may hold addition configuration data.
Defined in: ListItemPropertyDefinition.php.
Attr. | Name / Description |
---|---|
public |
ListItemPropertyDefinition($context) Create an empty list item property definiton object. |
Name | Description |
---|---|
TYPE_CHECKBOX | Value indicating a checkbox property. |
TYPE_COLOR | Value indicating a color property. |
TYPE_DATE_TIME | Value indicating a date property. |
TYPE_HTML_TEXT | Value indicating a html textarea property. |
TYPE_IMAGE | Value indicating an img property. |
TYPE_INFO | Value indicating an informative text. |
TYPE_INPUT | Value indicating an input field property. |
TYPE_SELECT | Value indicating a select list property. |
TYPE_TAB | Value indicating a tab in the user interface. |
TYPE_TEXT | Value indicating a textarea property. |
TYPE_URL | Value indicating a url property. |
Attr. | Type | Name | Description |
---|---|---|---|
int | $applicationDefinitionId | The id of the list/application definition where this list item property defintion belongs to. | |
read-only | int | $id | The list item property defintion id (DB key). |
boolean | $inList | Setting to show or hide this property in item lists in the user interface. | |
int | $listItemDefinitionId | The id of the list item definition where this list item property defintion belongs to. | |
\..\String | $phpSelector | A textual identification/key for this list item property. | |
\..\String | $title | A descriptive name for the list item property. | |
\..\String | $type | The list item property type, one out of ListItemProperty::TYPE_* constants. | |
stdClass | $typeData | Optional data needed to for this specific property type. |
Attr. | Type | Name | Description |
---|---|---|---|
private | int | $applicationDefinitionId | The id of the list/application definition where this list item property defintion belongs to. |
private | \..\Context | $context | A Scrivo context. |
private | int | $id | The list item property defintion id (DB key). |
private | boolean | $inList | Setting to show or hide this property in item lists in the user interface. |
private | int | $listItemDefinitionId | The id of the list item definition where this list item property defintion belongs to. |
private | \..\String | $phpSelector | A textual identification/key for this list item property. |
private | int | $sequenceNo | The sequence number of the list item definition defintion. |
private | \..\String | $title | A descriptive name for the list item property. |
private | \..\String | $type | The list item property type, one out of ListItemProperty::TYPE_* constants. |
private | stdClass | $typeData | Optional data needed to for this specific property type. |
Attr. | Type | Name / Description |
---|---|---|
public | mixed |
__get($name) Implementation of the readable properties using the PHP magic method __get(). |
public |
__set($name, $value) Implementation of the writable properties using the PHP magic method __set(). |
|
public static |
delete($context, $id) Delete existing list item property definiton data from the database. |
|
public static | \..\ListItemPropertyDefinition |
fetch($context, $id) Fetch a list item property definiton object from the database using its object id. |
private | \..\String |
Create a string representation of the type data member. |
public static | \..\String[] |
getTypes() Get an array of the possible property types. |
public |
insert() Insert new list item property definiton object data into the database. |
|
public |
move($dir) Move a list item property one position up or down. |
|
private | int |
readStr($val) Convert a string to its most likely type. |
public static | \..\ListItemPropertyDefinition[] |
select($context, $applicationDefinitionId) Select list item property definitons from the database. |
public |
setApplicationDefinitionId($appId) Set the id of the list/application definition where this list item property belongs to. |
|
private |
setFields($context, $rd) Convenience method to set the fields of a list item property definiton object from an array (result set row). |
|
private |
setInList($inList) Set Setting to show or hide this property in item lists in the user interface. |
|
private |
setListItemDefinitionId($defId) Set the id of the list item definition where this list item property belongs to. |
|
private |
setPhpSelector($phpSelector) Set A textual identification/key for this list item property. |
|
private |
setTitle($title) Set A descriptive name for the list item property. |
|
private |
setType($type) Set The list item property's type, one out of ListItemPropertyDefinition::TYPE_* constants. |
|
private |
setTypeData($typeData) Set Optional data needed to for this specific property type. |
|
private |
setTypeDataAsString($str) Set the type data member form a string representation. |
|
private |
setTypeDataFromRS($rs) Convert plain text type data to an object. |
|
public |
update() Update existing list item property definiton object data in the database. |
|
private static |
validateDelete($context, $id) Check if deletion of list item property definiton object data does not violate any business rules. |
|
private |
Check if this list item property definiton object can be inserted into the database. |
|
private |
Check if this list item property definiton object can be updated in the database. |
Constructor
- public ListItemPropertyDefinition(\Scrivo\Context $context=null)
-
Create an empty list item property definiton object.
Parameters:
Type Name Def. Description \Scrivo\Context $context null A Scrivo context.
View source: ListItemPropertyDefinition.php line 191.
Constants
- TYPE_CHECKBOX
-
Value indicating a checkbox property.
Value: "checkbox"
View source: ListItemPropertyDefinition.php line 95.
- TYPE_COLOR
-
Value indicating a color property.
Value: "color"
View source: ListItemPropertyDefinition.php line 85.
- TYPE_DATE_TIME
-
Value indicating a date property.
Value: "datetime"
View source: ListItemPropertyDefinition.php line 110.
- TYPE_HTML_TEXT
-
Value indicating a html textarea property.
Value: "html_text"
View source: ListItemPropertyDefinition.php line 100.
- TYPE_IMAGE
-
Value indicating an img property.
Value: "img"
View source: ListItemPropertyDefinition.php line 70.
- TYPE_INFO
-
Value indicating an informative text.
Value: "info"
View source: ListItemPropertyDefinition.php line 120.
- TYPE_INPUT
-
Value indicating an input field property.
Value: "input"
View source: ListItemPropertyDefinition.php line 75.
- TYPE_SELECT
-
Value indicating a select list property.
Value: "select"
View source: ListItemPropertyDefinition.php line 80.
- TYPE_TAB
-
Value indicating a tab in the user interface.
Value: "tab"
View source: ListItemPropertyDefinition.php line 115.
- TYPE_TEXT
-
Value indicating a textarea property.
Value: "text"
View source: ListItemPropertyDefinition.php line 105.
- TYPE_URL
-
Value indicating a url property.
Value: "url"
View source: ListItemPropertyDefinition.php line 90.
Members
- private int $applicationDefinitionId
-
The id of the list/application definition where this list item property defintion belongs to.
Inital value: 0
View source: ListItemPropertyDefinition.php line 133.
- private \Scrivo\Context $context
-
A Scrivo context.
Inital value: null
View source: ListItemPropertyDefinition.php line 184.
- private int $id
-
The list item property defintion id (DB key).
Inital value: 0
View source: ListItemPropertyDefinition.php line 126.
- private boolean $inList
-
Setting to show or hide this property in item lists in the user interface.
Inital value: false
View source: ListItemPropertyDefinition.php line 178.
- private int $listItemDefinitionId
-
The id of the list item definition where this list item property defintion belongs to.
Inital value: 0
View source: ListItemPropertyDefinition.php line 140.
- private \Scrivo\String $phpSelector
-
A textual identification/key for this list item property.
Inital value: null
View source: ListItemPropertyDefinition.php line 165.
- private int $sequenceNo
-
The sequence number of the list item definition defintion.
Inital value: 0
View source: ListItemPropertyDefinition.php line 146.
- private \Scrivo\String $title
-
A descriptive name for the list item property.
Inital value: null
View source: ListItemPropertyDefinition.php line 171.
- private \Scrivo\String $type
-
The list item property type, one out of ListItemProperty::TYPE_* constants.
Inital value: ""
View source: ListItemPropertyDefinition.php line 153.
- private \stdClass $typeData
-
Optional data needed to for this specific property type.
Inital value: null
View source: ListItemPropertyDefinition.php line 159.
Methods
- public mixed __get(string $name)
-
Implementation of the readable properties using the PHP magic method __get().
Parameters:
Type Name Def. Description string $name The name of the property to get.
Returns:
mixed Implementation of the readable properties using the PHP magic method __get().
View source: ListItemPropertyDefinition.php line 211.
- public __set(string $name, mixed $value)
-
Implementation of the writable properties using the PHP magic method __set().
Parameters:
Type Name Def. Description string $name The name of the property to set.
mixed $value The value of the property to set.
View source: ListItemPropertyDefinition.php line 233.
- public static delete(\Scrivo\Context $context, int $id)
-
Delete existing list item property definiton data from the database.
First it is is checked if it's possible to delete list item property definiton data, then the list item property definiton data including its dependencies is deleted from the database.
Parameters:
Type Name Def. Description \Scrivo\Context $context A Scrivo context.
int $id The object id of the list item property definiton to select.
Throws:
Exception Type Description \Scrivo\ApplicationException If the data is not accessible or if it is not possible to delete the list item property definiton data. View source: ListItemPropertyDefinition.php line 599.
- public static \Scrivo\ListItemPropertyDefinition fetch(\Scrivo\Context $context, int $id)
-
Fetch a list item property definiton object from the database using its object id.
Parameters:
Type Name Def. Description \Scrivo\Context $context A Scrivo context.
int $id The object id of the list item property definiton to select.
Returns:
\Scrivo\ListItemPropertyDefinition Fetch a list item property definiton object from the database using its object id.
View source: ListItemPropertyDefinition.php line 649.
- private \Scrivo\String getTypeDataAsString()
-
Create a string representation of the type data member.
Returns:
\Scrivo\String Create a string representation of the type data member.
View source: ListItemPropertyDefinition.php line 421.
- public static \Scrivo\String[] getTypes()
-
Get an array of the possible property types.
Returns:
\Scrivo\String[] Get an array of the possible property types.
View source: ListItemPropertyDefinition.php line 275.
- public insert()
-
Insert new list item property definiton object data into the database.
First it is checked if the data of this list item property definiton object can be inserted into the database, then the data is inserted into the database. If no id was set a new object id is generated.
Throws:
Exception Type Description \Scrivo\ApplicationException If the data is not accessible or one or more of the fields contain invalid data. View source: ListItemPropertyDefinition.php line 470.
- public move(int $dir=\Scrivo\SequenceNo::MOVE_DOWN)
-
Move a list item property one position up or down.
Parameters:
Type Name Def. Description int $dir \Scrivo\SequenceNo::MOVE_DOWN Direction of the move, see \Scrivo\SequenceNo:::MOVE_*
View source: ListItemPropertyDefinition.php line 630.
- private int readStr(string $val)
-
Convert a string to its most likely type.
Parameters:
Type Name Def. Description string $val The value to convert to either an int, float or \Scrivo\String.
Returns:
int Convert a string to its most likely type.
View source: ListItemPropertyDefinition.php line 395.
- public static \Scrivo\ListItemPropertyDefinition[id] select(\Scrivo\Context $context, int $applicationDefinitionId)
-
Select list item property definitons from the database.
Parameters:
Type Name Def. Description \Scrivo\Context $context A Scrivo context.
int $applicationDefinitionId The id of the application for which to retrieve the list item properties.
Returns:
\Scrivo\ListItemPropertyDefinition[id] Select list item property definitons from the database.
View source: ListItemPropertyDefinition.php line 704.
- public setApplicationDefinitionId(int $appId)
-
Set the id of the list/application definition where this list item property belongs to.
It is only possible to set the application id for uninitialized list item properties.
Parameters:
Type Name Def. Description int $appId The id of the list/application definition where this list item property belongs to.
View source: ListItemPropertyDefinition.php line 299.
- private setFields(\Scrivo\Context $context, array $rd)
-
Convenience method to set the fields of a list item property definiton object from an array (result set row).
Parameters:
Type Name Def. Description \Scrivo\Context $context A Scrivo context.
array $rd An array containing the field data using the database field names as keys.
View source: ListItemPropertyDefinition.php line 256.
- private setInList(boolean $inList)
-
Set Setting to show or hide this property in item lists in the user interface.
Parameters:
Type Name Def. Description boolean $inList Setting to show or hide this property in item lists in the user interface.
View source: ListItemPropertyDefinition.php line 378.
- private setListItemDefinitionId(int $defId)
-
Set the id of the list item definition where this list item property belongs to.
Parameters:
Type Name Def. Description int $defId The id of the list/application definition where this list item property belongs to.
View source: ListItemPropertyDefinition.php line 318.
- private setPhpSelector(\Scrivo\String $phpSelector)
-
Set A textual identification/key for this list item property.
Parameters:
Type Name Def. Description \Scrivo\String $phpSelector A textual identification/key for this list item property.
View source: ListItemPropertyDefinition.php line 357.
- private setTitle(\Scrivo\String $title)
-
Set A descriptive name for the list item property.
Parameters:
Type Name Def. Description \Scrivo\String $title A descriptive name for the list item property.
View source: ListItemPropertyDefinition.php line 367.
- private setType(string $type)
-
Set The list item property's type, one out of ListItemPropertyDefinition::TYPE_* constants.
Parameters:
Type Name Def. Description string $type The list item property's type, one out of ListItemPropertyDefinition::TYPE_* constants.
View source: ListItemPropertyDefinition.php line 333.
- private setTypeData(\stdClass $typeData)
-
Set Optional data needed to for this specific property type.
Parameters:
Type Name Def. Description \stdClass $typeData Optional data needed to for this specific property type.
View source: ListItemPropertyDefinition.php line 347.
- private setTypeDataAsString(\Scrivo\String $str)
-
Set the type data member form a string representation.
The format of the string should be NAME1=VALUE1\nNAME2=VALUE2\nNAME3...etc.
Parameters:
Type Name Def. Description \Scrivo\String $str The type data string.
View source: ListItemPropertyDefinition.php line 435.
- private setTypeDataFromRS(array $rs)
-
Convert plain text type data to an object.
Parameters:
Type Name Def. Description array $rs The type data as stored in the database (result set row).
View source: ListItemPropertyDefinition.php line 412.
- public update()
-
Update existing list item property definiton object data in the database.
First it is checked if the data of this list item property definiton object can be updated in the database, then the data is updated in the database.
Throws:
Exception Type Description \Scrivo\ApplicationException If the data is not accessible or one or more of the fields contain invalid data. View source: ListItemPropertyDefinition.php line 534.
- private static validateDelete(\Scrivo\Context $context, int $id)
-
Check if deletion of list item property definiton object data does not violate any business rules.
Parameters:
Type Name Def. Description \Scrivo\Context $context A Scrivo context.
int $id The object id of the list item property definiton to select.
Throws:
Exception Type Description \Scrivo\ApplicationException If the data is not accessible or if it is not possible to delete the language data. View source: ListItemPropertyDefinition.php line 581.
- private validateInsert()
-
Check if this list item property definiton object can be inserted into the database.
Throws:
Exception Type Description \Scrivo\ApplicationException If the data is not accessible or one or more of the fields contain invalid data. View source: ListItemPropertyDefinition.php line 456.
- private validateUpdate()
-
Check if this list item property definiton object can be updated in the database.
Throws:
Exception Type Description \Scrivo\ApplicationException If the data is not accessible or one or more of the fields contain invalid data. View source: ListItemPropertyDefinition.php line 520.
Documentation generated by phpDocumentor 2.0.0a12 and ScrivoDocumentor on August 29, 2013