Function RevisionEngineDatabase->add_revision
Definitions
sources/revisions_engine_database.php
- Add a revision.
- Visibility: public
- Is abstract?: No
- Is static?: No
- Is final?: No
Parameters
| Name | Type | Passed by reference? | Variadic? | Default | Set | Range | Description |
|---|---|---|---|---|---|---|---|
| $resource_type | string | No | No | required parameter | N/A | N/A | Resource type |
| $resource_id | string | No | No | required parameter | N/A | N/A | Resource ID |
| $category_id | string | No | No | required parameter | N/A | N/A | Category ID (e.g. a page or a topic). May be the same as $resource_id if the revision is for the category itself. |
| $original_title | string | No | No | required parameter | N/A | N/A | Title before revision (of the resource being edited, not the category) (blank: very common, no title) |
| $original_text | string | No | No | required parameter | N/A | N/A | Text before revision |
| $original_content_owner | MEMBER | No | No | required parameter | N/A | N/A | Owner of the content (gathered so if deleted we can still see some meta context for this resource) |
| $original_content_timestamp | TIME | No | No | required parameter | N/A | N/A | Original timestamp of the content (gathered so if deleted we can still see some meta context for this resource) |
| $log_id | ?AUTO_LINK | No | No | required parameter | N/A | N/A | Log ID (null: no ID, meaning actually we cannot save a revision at all) |
Preview
Code (PHP)
/**
* Add a revision.
*
* @param string $resource_type Resource type
* @param string $resource_id Resource ID
* @param string $category_id Category ID (e.g. a page or a topic). May be the same as $resource_id if the revision is for the category itself.
* @param string $original_title Title before revision (of the resource being edited, not the category) (blank: very common, no title)
* @param string $original_text Text before revision
* @param MEMBER $original_content_owner Owner of the content (gathered so if deleted we can still see some meta context for this resource)
* @param TIME $original_content_timestamp Original timestamp of the content (gathered so if deleted we can still see some meta context for this resource)
* @param ?AUTO_LINK $log_id Log ID (null: no ID, meaning actually we cannot save a revision at all)
*/
public function add_revision(string $resource_type, string $resource_id, string $category_id, string $original_title, string $original_text, int $original_content_owner, int $original_content_timestamp, ?int $log_id)
* Add a revision.
*
* @param string $resource_type Resource type
* @param string $resource_id Resource ID
* @param string $category_id Category ID (e.g. a page or a topic). May be the same as $resource_id if the revision is for the category itself.
* @param string $original_title Title before revision (of the resource being edited, not the category) (blank: very common, no title)
* @param string $original_text Text before revision
* @param MEMBER $original_content_owner Owner of the content (gathered so if deleted we can still see some meta context for this resource)
* @param TIME $original_content_timestamp Original timestamp of the content (gathered so if deleted we can still see some meta context for this resource)
* @param ?AUTO_LINK $log_id Log ID (null: no ID, meaning actually we cannot save a revision at all)
*/
public function add_revision(string $resource_type, string $resource_id, string $category_id, string $original_title, string $original_text, int $original_content_owner, int $original_content_timestamp, ?int $log_id)

