Class \Scrivo\Page
A Scrivo Page is most essential Scrivo entity.
A Scrivo page models a HTML Page (most of the times). The idea is that a Web site is a set of pages. The dynamic content that should be presented on these web pages is contained by Scrivo Page objects.
Therefore a Scrivo page contains some of the standard fields that are typical for a HTML page suchs as the page title, description and keywords along with some managerial (CMS) information as online and ofline date.
What other content should be displayed on the page is determined by its page defintion. Each page is constructed using a a page defintion and this defintion holds the defintions for all other data (properties, texts, lists, applications) that can added to the page.
The Scrivo editor interface provides the means to the editor to create pages and fill in the page properties.
How the content that is assigned to the page should be displayed on the page is determined by the page template. The page defintion has a member that refers to the page template: a user defined script that renders the actual page.
Defined in: Page.php.
Attr. | Name / Description |
---|---|
public |
Page($context) Create an empty page object. |
Name | Description |
---|---|
TYPE_APPLICATION | Value indicating an application: a page that has no functionality as a page but hosts an application in the scrivo user interface. |
TYPE_NAVIGABLE_PAGE | Value indicating a page that should be shown in the site menu. |
TYPE_NAVIGATION_ITEM | Value indicating a navigation item (page that only functions as a node). |
TYPE_NON_NAVIGABLE_PAGE | Value indicating a page that should not be shown in the site menu. |
TYPE_SUB_FOLDER | Value indicating an extra node to hold automatically generated pages that are linked to list items. |
Attr. | Type | Name | Description |
---|---|---|---|
read-only | \..\PageSet | $children | The child pages of this page. |
\..\Context | $context | A Scrivo context of this page. | |
read-only | DateTime | $dateCreated | The date/time that this page was created. |
read-only | DateTime | $dateModified | The last date/time that this page was modified. |
DateTime | $dateOffline | The date/time this page need to go offline. | |
DateTime | $dateOnline | The date/time this page need to go online. | |
read-only | \..\PageDefinition | $definition | The page definition of this page. |
write-only | int | $definitionId | The id of the page template. |
\..\String | $description | The page description (<description>). | |
boolean | $hasStaging | Setting to indicate if the page can be staged. | |
read-only | int | $id | The page id (DB key). |
read-only | \..\booleand | $isOnline | If this page is online or not. |
\..\String | $javascript | A javascript script for this page (<script>). | |
\..\String | $keywords | The keywords for this page (<keywords>). | |
read-only | \..\Language | $language | The main language for the page (<html lang>). |
write-only | int | $languageId | The id of the main language for the page (<html lang>). |
read-only | \..\PageSet | $navigableChildren | The navigable child pages of this page. |
int | $parentId | The id of the parent page. | |
read-only | \..\PageSet | $path | The parent pages of this page. |
read-only | \..\PropertySet | $properties | The page properties as a PHP object in which the members correspond with the PHP selector names. |
read-only | \..\RoleSet | $roles | The attached roles. |
\..\String | $stylesheet | Additional CSS syle rules for this page (<stylesheet>). | |
\..\String | $title | The page title (<title>). | |
int | $type | The page type: one out of the Page::TYPE_* constant values. |
Attr. | Type | Name | Description |
---|---|---|---|
private | \..\PageSet | $children | The child pages of this page. |
private | \..\Context | $context | A Scrivo context. |
private | DateTime | $dateCreated | The date/time that this page was created. |
private | DateTime | $dateModified | The last date/time that this page was modified. |
private | DateTime | $dateOffline | The date/time this page need to go offline. |
private | DateTime | $dateOnline | The date/time this page need to go online. |
private | int | $definitionId | The id of the page template. |
private | \..\String | $description | The page description (<description>). |
private | boolean | $hasStaging | Setting to indicate if the page can be staged. |
private | int | $id | The page id (DB key). |
private | \..\String | $javascript | A javascript script for this page (<script>). |
private | \..\String | $keywords | The keywords for this page (<keywords>). |
private | int | $languageId | The id the main language for the page (<html lang>). |
private | int | $parentId | The id of the parent page. |
private | \..\PageSet | $path | The parent pages of this page. |
private | \..\PropertySet | $properties | The page properties as a PHP object in which the members correspond with the PHP selector names. |
private | \..\RoleSet | $roles | The attached roles. |
private | \..\String | $stylesheet | Additional CSS syle rules for this page (<stylesheet>). |
private | \..\String | $title | The page title (<title>). |
private | int | $type | The page type: one out of the Page::TYPE_* constant values. |
private | int | $version | The current version of the page: -1: scratch version, 0 live version, 1 and up versions. |
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 an existing page from the database. |
|
public static |
fetch($context, $id) Retrieve a page from the database or cache. |
|
private | \..\PageSet |
Get the child pages of this page. |
private | boolean |
Check if this page is online. |
private | \..\PageSet |
Get the navigable child pages of this page. |
private | \..\PageSet |
getPath() Get the child pages of this page. |
private | object |
Get this pages's property list. |
public |
insert() Insert a new page into the database. |
|
public |
move($dir) Move a page one position up or down amongst its siblings. |
|
private static | \..\PageSet |
selectChildren($page) Select child pages from the database. |
private static | \..\PageSet |
selectPath($page) Select the page path. |
private static |
selectProperties($context, $pages) Select the page properties from the database. |
|
private static |
selectRoles($context, $pages) Select the roles for this page. |
|
private |
setContext($context) Set the page context. |
|
private |
setDateOffline($dateOffline) Set the date/time this page need to go offline. |
|
private |
setDateOnline($dateOnline) Set the date/time this page needs to go online. |
|
private |
setDefinitionId($definitionId) Set the id of the page template. |
|
private |
setDescription($description) Set the page description (<description>). |
|
private |
setFields($context, $rd) Convenience method to set the fields of a page definition object from an array (result set row). |
|
private |
setHasStaging($hasStaging) Set the setting to indicate if a page can be staged. |
|
private |
setJavascript($javascript) Set a javascript script for this page (<script>). |
|
private |
setKeywords($keywords) Set the keywords for this page (<keywords>). |
|
private |
setLanguageId($languageId) Set the id the main language for the page (<html lang>). |
|
private |
setParentPageId($parentId) Set the id of the parent page. |
|
private |
setStylesheet($stylesheet) Set additional CSS syle rules for this page (<stylesheet>). |
|
private |
setTitle($title) Set The page title (<title>). |
|
private |
setType($type) Set the page type: one out of the Page::TYPE_* constant values. |
|
public static |
touch($context, $id) Touch (update modification time) a page. |
|
public |
update() Update an existing page in the database. |
|
private static |
validateDelete($context, $id) Check if deletion of page object data does not violate any business rules. |
|
private |
Check if the page data can be inserted into the database. |
|
private |
Check if the page data can be updated in the database. |
Constructor
- public Page(\Scrivo\Context $context=null)
-
Create an empty page object.
Parameters:
Type Name Def. Description \Scrivo\Context $context null A Scrivo context.
View source: Page.php line 260.
Constants
- TYPE_APPLICATION
-
Value indicating an application: a page that has no functionality as a page but hosts an application in the scrivo user interface.
Value: 5
View source: Page.php line 125.
- TYPE_NAVIGABLE_PAGE
-
Value indicating a page that should be shown in the site menu.
Value: 1
View source: Page.php line 108.
- TYPE_NAVIGATION_ITEM
-
Value indicating a navigation item (page that only functions as a node).
Value: 0
View source: Page.php line 103.
- TYPE_NON_NAVIGABLE_PAGE
-
Value indicating a page that should not be shown in the site menu.
Value: 2
View source: Page.php line 113.
- TYPE_SUB_FOLDER
-
Value indicating an extra node to hold automatically generated pages that are linked to list items.
Value: 4
View source: Page.php line 119.
Members
- private \Scrivo\PageSet $children
-
The child pages of this page.
Inital value: null
View source: Page.php line 235.
- private \Scrivo\Context $context
-
A Scrivo context.
Inital value: null
View source: Page.php line 253.
- private \DateTime $dateCreated
-
The date/time that this page was created.
Inital value: null
View source: Page.php line 204.
- private \DateTime $dateModified
-
The last date/time that this page was modified.
Inital value: null
View source: Page.php line 210.
- private \DateTime $dateOffline
-
The date/time this page need to go offline.
Inital value: null
View source: Page.php line 222.
- private \DateTime $dateOnline
-
The date/time this page need to go online.
Inital value: null
View source: Page.php line 216.
- private int $definitionId
-
The id of the page template.
Inital value: 0
View source: Page.php line 162.
- private \Scrivo\String $description
-
The page description (<description>).
Inital value: null
View source: Page.php line 180.
- private boolean $hasStaging
-
Setting to indicate if the page can be staged.
Inital value: 0
View source: Page.php line 144.
- private int $id
-
The page id (DB key).
Inital value: 0
View source: Page.php line 131.
- private \Scrivo\String $javascript
-
A javascript script for this page (<script>).
Inital value: null
View source: Page.php line 192.
- private \Scrivo\String $keywords
-
The keywords for this page (<keywords>).
Inital value: null
View source: Page.php line 186.
- private int $languageId
-
The id the main language for the page (<html lang>).
Inital value: 0
View source: Page.php line 168.
- private int $parentId
-
The id of the parent page.
Inital value: 0
View source: Page.php line 150.
- private \Scrivo\PageSet $path
-
The parent pages of this page.
Inital value: null
View source: Page.php line 241.
- private \Scrivo\PropertySet $properties
-
The page properties as a PHP object in which the members correspond with the PHP selector names.
Inital value: null
View source: Page.php line 229.
- private \Scrivo\RoleSet $roles
-
The attached roles.
Inital value: null
View source: Page.php line 247.
- private \Scrivo\String $stylesheet
-
Additional CSS syle rules for this page (<stylesheet>).
Inital value: null
View source: Page.php line 198.
- private \Scrivo\String $title
-
The page title (<title>).
Inital value: null
View source: Page.php line 174.
- private int $type
-
The page type: one out of the Page::TYPE_* constant values.
Inital value: 0
View source: Page.php line 156.
- private int $version
-
The current version of the page: -1: scratch version, 0 live version, 1 and up versions.
Inital value: 0
View source: Page.php line 138.
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: Page.php line 297.
- 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: Page.php line 336.
- public static delete(\Scrivo\Context $context, int $id)
-
Delete an existing page from the database.
First it is is checked if it's possible to delete this page then the page data including its dependecies is deleted from the database.
Parameters:
Type Name Def. Description \Scrivo\Context $context A Scrivo context.
int $id The id of the page to delete.
Throws:
Exception Type Description \Scrivo\ApplicationException If it is not possible to delete this page. View source: Page.php line 1018.
- public static fetch(\Scrivo\Context $context, int $id=null)
-
Retrieve a page from the database or cache.
Parameters:
Type Name Def. Description \Scrivo\Context $context A Scrivo context.
int $id null An object id of a page.
Throws:
Exception Type Description \Scrivo\ApplicationException if the page was not readable for the user defined in the context. View source: Page.php line 1085.
- private \Scrivo\PageSet getChildren()
-
Get the child pages of this page.
Returns:
\Scrivo\PageSet Get the child pages of this page.
View source: Page.php line 404.
- private boolean getIsOnline()
-
Check if this page is online.
Returns:
boolean Check if this page is online.
View source: Page.php line 446.
- private \Scrivo\PageSet getNavigableChildren()
-
Get the navigable child pages of this page.
Returns:
\Scrivo\PageSet Get the navigable child pages of this page.
View source: Page.php line 417.
- private \Scrivo\PageSet getPath()
-
Get the child pages of this page.
Returns:
\Scrivo\PageSet Get the child pages of this page.
View source: Page.php line 433.
- private object getProperties()
-
Get this pages's property list.
Returns:
object Get this pages's property list.
View source: Page.php line 391.
- public insert()
-
Insert a new page into the database.
First the data fields of this page will be validated. If no id is set a new object id is generated. Then the data is inserted into to database.
Throws:
Exception Type Description \Scrivo\ApplicationException If one or more of the fields contain invalid data. View source: Page.php line 761.
- public move(int $dir=\Scrivo\SequenceNo::MOVE_DOWN)
-
Move a page one position up or down amongst its siblings.
Parameters:
Type Name Def. Description int $dir \Scrivo\SequenceNo::MOVE_DOWN Direction of the move, see \Scrivo\SequenceNo:::MOVE_*
View source: Page.php line 1060.
- private static \Scrivo\PageSet selectChildren(\Scrivo\Page $page)
-
Select child pages from the database.
Parameters:
Type Name Def. Description \Scrivo\Page $page A Scrivo page.
Returns:
\Scrivo\PageSet Select child pages from the database.
View source: Page.php line 1146.
- private static \Scrivo\PageSet selectPath(\Scrivo\Page $page)
-
Select the page path.
Parameters:
Type Name Def. Description \Scrivo\Page $page A Scrivo page.
Returns:
\Scrivo\PageSet Select the page path.
View source: Page.php line 1210.
- private static selectProperties(\Scrivo\Context $context, array $pages)
-
Select the page properties from the database.
Parameters:
Type Name Def. Description \Scrivo\Context $context A valid Scrivo context.
array $pages the set of pages for which to retrieve the properties.
View source: Page.php line 613.
- private static selectRoles(\Scrivo\Context $context, array $pages)
-
Select the roles for this page.
Parameters:
Type Name Def. Description \Scrivo\Context $context A valid Scrivo context.
array $pages the set of pages for which to retrieve the properties.
View source: Page.php line 683.
- private setContext(\Scrivo\Context $context)
-
Set the page context.
Parameters:
Type Name Def. Description \Scrivo\Context $context A Scrivo context.
View source: Page.php line 602.
- private setDateOffline(\DateTime $dateOffline=null)
-
Set the date/time this page need to go offline.
Parameters:
Type Name Def. Description \DateTime $dateOffline null The date/time this page need to go offline.
View source: Page.php line 593.
- private setDateOnline(\DateTime $dateOnline)
-
Set the date/time this page needs to go online.
Parameters:
Type Name Def. Description \DateTime $dateOnline The date/time this page needs to go online.
View source: Page.php line 584.
- private setDefinitionId(int $definitionId)
-
Set the id of the page template.
Parameters:
Type Name Def. Description int $definitionId The id ot the page template.
View source: Page.php line 506.
- private setDescription(\Scrivo\String $description)
-
Set the page description (<description>).
Parameters:
Type Name Def. Description \Scrivo\String $description The page description (<description>).
View source: Page.php line 545.
- private setFields(\Scrivo\Context $context, array $rd)
-
Convenience method to set the fields of a page definition 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: Page.php line 363.
- private setHasStaging(boolean $hasStaging)
-
Set the setting to indicate if a page can be staged.
Parameters:
Type Name Def. Description boolean $hasStaging Setting to indicate if a page can be staged.
View source: Page.php line 466.
- private setJavascript(\Scrivo\String $javascript)
-
Set a javascript script for this page (<script>).
Parameters:
Type Name Def. Description \Scrivo\String $javascript A javascript script for this page (<script>).
View source: Page.php line 565.
- private setKeywords(\Scrivo\String $keywords)
-
Set the keywords for this page (<keywords>).
Parameters:
Type Name Def. Description \Scrivo\String $keywords The keywords for this page (<keywords>).
View source: Page.php line 555.
- private setLanguageId(int $languageId)
-
Set the id the main language for the page (<html lang>).
Parameters:
Type Name Def. Description int $languageId The id the main language for the page (<html lang>).
View source: Page.php line 523.
- private setParentPageId(int $parentId)
-
Set the id of the parent page.
Parameters:
Type Name Def. Description int $parentId The id of the parent page.
View source: Page.php line 478.
- private setStylesheet(\Scrivo\String $stylesheet)
-
Set additional CSS syle rules for this page (<stylesheet>).
Parameters:
Type Name Def. Description \Scrivo\String $stylesheet Additional CSS syle rules for this page (<stylesheet>).
View source: Page.php line 575.
- private setTitle(\Scrivo\String $title)
-
Set The page title (<title>).
Parameters:
Type Name Def. Description \Scrivo\String $title The page title (<title>).
View source: Page.php line 535.
- private setType(int $type)
-
Set the page type: one out of the Page::TYPE_* constant values.
Parameters:
Type Name Def. Description int $type The page type: one out of the Page::TYPE_* constant values.
View source: Page.php line 491.
- public static touch(\Scrivo\Context $context, int $id)
-
Touch (update modification time) a page.
Parameters:
Type Name Def. Description \Scrivo\Context $context A Scrivo context.
int $id The id of the page to touch.
View source: Page.php line 982.
- public update()
-
Update an existing page in the database.
First the data fields of this user will be validated, then the data is updated in to database.
Throws:
Exception Type Description \Scrivo\ApplicationException If one or more of the fields contain invalid data. View source: Page.php line 855.
- private static validateDelete(\Scrivo\Context $context, int $id)
-
Check if deletion of page 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 definition 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: Page.php line 934.
- private validateInsert()
-
Check if the page data can be inserted into the database.
Throws:
Exception Type Description \Scrivo\ApplicationException If the data is not accessible, one or more of the fields contain invalid data or some other business rule is not met. View source: Page.php line 711.
- private validateUpdate()
-
Check if the page data can be updated in the database.
Throws:
Exception Type Description \Scrivo\ApplicationException If the data is not accessible, one or more of the fields contain invalid data or some other business rule is not met. View source: Page.php line 832.
Documentation generated by phpDocumentor 2.0.0a12 and ScrivoDocumentor on August 29, 2013