Class \Scrivo\PageDefinitionTab
The class PageDefinitionTab is used to create tabs in the Scrivo user interface.
A page can have can a number of configurable properities, which are defined by the page definition. The PageDefinitionTab class is used as a means to distribute these properties over different tabs in the Scrivo user interface.
With respect to the content this class has no function at all, it is used for display purposes.
TODO: The page_definition_tab table is still used to hold property data for 'html_text' and 'application' tabs. Access to this data is handled bij the PageProperty class now. In a later version the data model should be changed also.
Defined in: PageDefinitionTab.php.
Attr. | Name / Description |
---|---|
public |
PageDefinitionTab($context) Create an empty page defintion tab object. |
Name | Description |
---|---|
TYPE_APPLICATION_TAB | Constant to mark a tab as an application tab. |
TYPE_HTML_TEXT_TAB | Constant to mark a tab as an html text tab. |
TYPE_PROPERTY_TAB | Constant to mark a tab as a property tab. |
Attr. | Type | Name | Description |
---|---|---|---|
read-only | int | $id | The page definition tab id (DB key). |
int | $pageDefinitionId | The page definition id of the page definition where this tab belongs to. | |
\..\String | $title | A descriptive title for the tab. | |
int | $type | The type of the tab: one out of the PageDefinitionTab::TYPE_* constant values. |
Attr. | Type | Name | Description |
---|---|---|---|
private | \..\Context | $context | A Scrivo context. |
private | int | $id | The page definition tab id (DB key). |
private | int | $pageDefinitionId | The page definition id of the page definition where this tab belongs to. |
private | \..\String | $title | A descriptive title for the tab. |
private | int | $type | The type of the tab: one out of the PageDefinitionTab::TYPE_* constant values. |
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 page defintion tab data from the database. |
|
public static | \..\PageDefinitionTab |
fetch($context, $id) Fetch a page defintion tab object from the database using its object id. |
public |
insert() Insert new page defintion tab object data into the database. |
|
public |
move($dir) Move an tab one position up (left) or down (right). |
|
public static | \..\PageDefinitionTab[] |
select($context, $pageDefinitionId) Select page defintion tabs from the database. |
private |
setFields($context, $rd) Convenience method to set the fields of a page defintion tab object from an array (result set row). |
|
private |
setPageDefinitionId($pageDefinitionId) Set The page definition id of the page definition where this tab belongs to. |
|
private |
setTitle($title) Set A descriptive title for the tab. |
|
private |
toType($rd) Set The type of the tab: one out of the PageDefinitionTab::TYPE_* constant values. |
|
public |
update() Update existing page defintion tab object data in the database. |
|
private static |
validateDelete($context, $id) Check if deletion of page defintion tab object data does not violate any business rules. |
|
private |
Check if this page defintion tab object can be inserted into the database. |
|
private |
Check if this page defintion tab object can be updated in the database. |
Constructor
- public PageDefinitionTab(\Scrivo\Context $context=null)
-
Create an empty page defintion tab object.
Parameters:
Type Name Def. Description \Scrivo\Context $context null A Scrivo context.
View source: PageDefinitionTab.php line 115.
Constants
- TYPE_APPLICATION_TAB
-
Constant to mark a tab as an application tab.
Value: 3
View source: PageDefinitionTab.php line 76.
- TYPE_HTML_TEXT_TAB
-
Constant to mark a tab as an html text tab.
Value: 2
View source: PageDefinitionTab.php line 71.
- TYPE_PROPERTY_TAB
-
Constant to mark a tab as a property tab.
Value: 1
View source: PageDefinitionTab.php line 66.
Members
- private \Scrivo\Context $context
-
A Scrivo context.
Inital value: null
View source: PageDefinitionTab.php line 108.
- private int $id
-
The page definition tab id (DB key).
Inital value: 0
View source: PageDefinitionTab.php line 82.
- private int $pageDefinitionId
-
The page definition id of the page definition where this tab belongs to.
Inital value: 0
View source: PageDefinitionTab.php line 89.
- private \Scrivo\String $title
-
A descriptive title for the tab.
Inital value: null
View source: PageDefinitionTab.php line 95.
- private int $type
-
The type of the tab: one out of the PageDefinitionTab::TYPE_* constant values.
Inital value: self::TYPE_PROPERTY_TAB
View source: PageDefinitionTab.php line 102.
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: PageDefinitionTab.php line 133.
- 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: PageDefinitionTab.php line 150.
- public static delete(\Scrivo\Context $context, int $id)
-
Delete existing page defintion tab data from the database.
First it is is checked if it's possible to delete page defintion tab data, then the page defintion tab 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 page defintion tab to select.
Throws:
Exception Type Description \Scrivo\ApplicationException If the data is not accessible or if it is not possible to delete the page defintion tab data. View source: PageDefinitionTab.php line 345.
- public static \Scrivo\PageDefinitionTab fetch(\Scrivo\Context $context, int $id)
-
Fetch a page defintion tab 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 page defintion tab to select.
Returns:
\Scrivo\PageDefinitionTab Fetch a page defintion tab object from the database using its object id.
View source: PageDefinitionTab.php line 394.
- public insert()
-
Insert new page defintion tab object data into the database.
First it is checked if the data of this page defintion tab 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: PageDefinitionTab.php line 240.
- public move(int $dir=\Scrivo\SequenceNo::MOVE_DOWN)
-
Move an tab one position up (left) or down (right).
Parameters:
Type Name Def. Description int $dir \Scrivo\SequenceNo::MOVE_DOWN Direction of the move, see \Scrivo\SequenceNo:::MOVE_*
View source: PageDefinitionTab.php line 374.
- public static \Scrivo\PageDefinitionTab[id] select(\Scrivo\Context $context, int $pageDefinitionId)
-
Select page defintion tabs from the database.
Parameters:
Type Name Def. Description \Scrivo\Context $context A Scrivo context.
int $pageDefinitionId The id of the pageDefinition for which to retrieve the tabs.
Returns:
\Scrivo\PageDefinitionTab[id] Select page defintion tabs from the database.
View source: PageDefinitionTab.php line 447.
- private setFields(\Scrivo\Context $context, array $rd)
-
Convenience method to set the fields of a page defintion tab 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: PageDefinitionTab.php line 167.
- private setPageDefinitionId(int $pageDefinitionId)
-
Set The page definition id of the page definition where this tab belongs to.
Parameters:
Type Name Def. Description int $pageDefinitionId The page definition id of the page definition where this tab belongs to.
View source: PageDefinitionTab.php line 185.
- private setTitle(\Scrivo\String $title)
-
Set A descriptive title for the tab.
Parameters:
Type Name Def. Description \Scrivo\String $title A descriptive title for the tab.
View source: PageDefinitionTab.php line 198.
- private toType(array $rd)
-
Set The type of the tab: one out of the PageDefinitionTab::TYPE_* constant values.
Parameters:
Type Name Def. Description array $rd Array (result set row) that contains the application_definition_id field.
View source: PageDefinitionTab.php line 209.
- public update()
-
Update existing page defintion tab object data in the database.
First it is checked if the data of this page defintion tab 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: PageDefinitionTab.php line 292.
- private static validateDelete(\Scrivo\Context $context, int $id)
-
Check if deletion of page defintion tab 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 page defintion tab 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: PageDefinitionTab.php line 328.
- private validateInsert()
-
Check if this page defintion tab 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: PageDefinitionTab.php line 226.
- private validateUpdate()
-
Check if this page defintion tab 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: PageDefinitionTab.php line 279.
Documentation generated by phpDocumentor 2.0.0a12 and ScrivoDocumentor on August 29, 2013