Skip to main content

Module entity_history

Module entity_history 

Source
Expand description

A snapshot of a chapter, course module or course’s settings after every save. Page history lives in page_history.

Structs§

EntityHistoryEntry
One history row; see insert.
EntityVersion
The newest history row of an entity: who last changed it and when.
HistoryAuthor
Who made a change that history records.

Enums§

EntityHistoryChangeReason
Why a history row was written.

Functions§

get_by_id
The history row.
insert
Records snapshot as a new history row. Only chapters, modules and course settings have history; the database refuses other entity types.
latest_version
The newest page_history or entity_history row of the page, chapter, module or course settings with the id, only in the course when course_id is given. None for glossary terms and references, which have no history, and for entities never saved since history was introduced.
record_current
record_current_many of one entity.
record_current_many
Records the current state of the entities as saved, as record_saved does. Deleted and missing entities are skipped.
record_deleted
Records the entity’s current state as deleted. Call it before deleting the entity; does nothing if it is already gone.
record_saved
Records each snapshot as saved, except those equal to their entity’s latest history row.
save_recording
Runs save in a transaction and then records the entity’s state as record_current does.