Class \Scrivo\ModifiedTouched
The ModifiedTouched class models the relation of pages that need to be touched (their modification date updated) when some other pages is updated.
It is very well possible to create pages that change due to the modification of another page. Suppose you have a selection of the last three news items of a new page. Adding news obviously changes the modification date of the new page which is important for indexing and caching, but the change on the home page will go unnoticed for the indexing or caching functionality.
Defined in: ModifiedTouched.php.
Attr. | Name / Description |
---|---|
public |
ModifiedTouched($context) Create an empty modified-touched relation entry or select a modified-touched relation entry from the database. |
Name | Description |
---|---|
TYPE_DOCUMENT_ID | Constant to the denote that the subject id is a document id. |
TYPE_TEMPLATE_ID | Constant to the denote that the subject id is a template id. |
Attr. | Type | Name | Description |
---|---|---|---|
int | $idModified | The id of the subject that is being modified. | |
int | $idTouched | The id of the subject that needs to be touched when the other subject is modified | |
read-only | int | $typeModified | The type of the subject that is being modified. |
read-only | int | $typeTouched | The type of the subject that needs to be touched when the other subject. |
Attr. | Type | Name | Description |
---|---|---|---|
private | \..\Context | $context | A Scrivo context. |
private | int | $idModified | The id of the subject that is being modified. |
private | int | $idTouched | The id of the subject that needs to be touched when the other subject is modified. |
private | int | $typeModified | The type of the subject that is being modified. |
private | int | $typeTouched | The type of the subject that needs to be touched when the other subject is modified. |
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, $idModified, $idTouched) Delete existing modified touched data from the database. |
|
public static | \..\ModifiedTouched |
fetch($context, $idModified, $idTouched) Fetch a modified touched object from the database using its object id. |
public |
insert() Insert new modified touched object data into the database. |
|
public static | \..\ModifiedTouched[] |
select($context) Select modified-touched relation entries from the database. |
private |
setFields($context, $rd) Convenience method to set the fields of a modified touched object from an array (result set row). |
|
private |
setIdModified($idModified) Set The id of the subject that is being modified. |
|
private |
setIdTouched($idTouched) Set The id of the subject that needs to be touched when the other subject is modified. |
|
private static |
validateDelete($context, $idModified, $idTouched) Check if deletion of modified touched object data does not violate any business rules. |
|
private |
Check if this modified touched object can be inserted into the database. |
Constructor
- public ModifiedTouched(\Scrivo\Context $context=null)
-
Create an empty modified-touched relation entry or select a modified-touched relation entry from the database.
Parameters:
Type Name Def. Description \Scrivo\Context $context null A Scrivo context.
View source: ModifiedTouched.php line 106.
Constants
- TYPE_DOCUMENT_ID
-
Constant to the denote that the subject id is a document id.
Value: 1
View source: ModifiedTouched.php line 61.
- TYPE_TEMPLATE_ID
-
Constant to the denote that the subject id is a template id.
Value: 2
View source: ModifiedTouched.php line 66.
Members
- private \Scrivo\Context $context
-
A Scrivo context.
Inital value: null
View source: ModifiedTouched.php line 98.
- private int $idModified
-
The id of the subject that is being modified.
Inital value: 0
View source: ModifiedTouched.php line 72.
- private int $idTouched
-
The id of the subject that needs to be touched when the other subject is modified.
Inital value: 0
View source: ModifiedTouched.php line 85.
- private int $typeModified
-
The type of the subject that is being modified.
Inital value: self::TYPE_DOCUMENT_ID
View source: ModifiedTouched.php line 78.
- private int $typeTouched
-
The type of the subject that needs to be touched when the other subject is modified.
Inital value: self::TYPE_TEMPLATE_ID
View source: ModifiedTouched.php line 92.
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: ModifiedTouched.php line 122.
- 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: ModifiedTouched.php line 139.
- public static delete(\Scrivo\Context $context, int $idModified, int $idTouched)
-
Delete existing modified touched data from the database.
First it is is checked if it's possible to delete modified touched data, then the modified touched data including its dependencies is deleted from the database.
Parameters:
Type Name Def. Description \Scrivo\Context $context A Scrivo context.
int $idModified The object id the a subject that is modified.
int $idTouched The object id of a subject that needs to be touched when the other subject is updated.
Throws:
Exception Type Description \Scrivo\ApplicationException If the data is not accessible or if it is not possible to delete the modified touched data. View source: ModifiedTouched.php line 273.
- public static \Scrivo\ModifiedTouched fetch(\Scrivo\Context $context, int $idModified, int $idTouched)
-
Fetch a modified touched object from the database using its object id.
Parameters:
Type Name Def. Description \Scrivo\Context $context A Scrivo context.
int $idModified The object id the a subject that is modified.
int $idTouched The object id of a subject that needs to be touched when the other subject is updated.
Returns:
\Scrivo\ModifiedTouched Fetch a modified touched object from the database using its object id.
View source: ModifiedTouched.php line 309.
- public insert()
-
Insert new modified touched object data into the database.
First it is checked if the data of this modified touched 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: ModifiedTouched.php line 213.
- public static \Scrivo\ModifiedTouched[] select(\Scrivo\Context $context)
-
Select modified-touched relation entries from the database.
Parameters:
Type Name Def. Description \Scrivo\Context $context A Scrivo context.
Returns:
\Scrivo\ModifiedTouched[] Select modified-touched relation entries from the database.
View source: ModifiedTouched.php line 352.
- private setFields(\Scrivo\Context $context, array $rd)
-
Convenience method to set the fields of a modified touched 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: ModifiedTouched.php line 155.
- private setIdModified(int $idModified)
-
Set The id of the subject that is being modified.
Parameters:
Type Name Def. Description int $idModified The id of the subject that is being modified.
View source: ModifiedTouched.php line 170.
- private setIdTouched(int $idTouched)
-
Set The id of the subject that needs to be touched when the other subject is modified.
Parameters:
Type Name Def. Description int $idTouched The id of the subject that needs to be touched when the other subject is modified.
View source: ModifiedTouched.php line 185.
- private static validateDelete(\Scrivo\Context $context, int $idModified, int $idTouched)
-
Check if deletion of modified touched object data does not violate any business rules.
Parameters:
Type Name Def. Description \Scrivo\Context $context A Scrivo context.
int $idModified The object id the a subject that is modified.
int $idTouched The object id of a subject that needs to be touched when the other subject is updated.
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: ModifiedTouched.php line 253.
- private validateInsert()
-
Check if this modified touched 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: ModifiedTouched.php line 199.
Documentation generated by phpDocumentor 2.0.0a12 and ScrivoDocumentor on August 29, 2013