pragma-framework / historic
The Pragma Module for handling models changelogs in Pragma Framework
Installs: 4 980
Dependents: 0
Suggesters: 0
Security: 0
Stars: 1
Watchers: 4
Forks: 4
Open Issues: 1
Requires
- php: >=7.0.0
- pragma-framework/core: >=1.0.0
- robmorgan/phinx: >=0.11.1
README
The Pragma Module for handling models changelogs in Pragma Framework.
Installation
In composer.json add:
require {"pragma-framework/historic": "dev-master"}
Howto use with Pragma/Model classes
In Model, add use Historisable;
and in Model::___construct $this->set_historised(true);
In Model::delete() add this->set_global_name($this->field)
(DEPRECATED)
In Model::__construct add $this->set_global_name_fields(['field']);
What about created_at and created_by
These columns should be handled by within the PRAGMA_HISTORIC_CREATION_HOOK constant (in the config.php)
CLI Route
Route used to empty all or part of the history
php public/index.php historic:clean [-d|--days=] [-s|--skip-confirm]
Options
-d --days
Number of days of history to keep
-s --skip-confirm
Skip confirmation (useful with crons)