ac-audit-trail Super classes that allow an audit trail to be built automatically for subclasses + nested transactions

  1. Documentation
  2. Change Log

This extension will allow models to be backed up by an audit trail. It also creates the functionality of nested transactions (MySQL tested).

Resources

Documentation

Requirements
  • Yii 1.0 or above
Installation
  • Extract the release file under protected/extensions (usually I use components, but extensions should be fine)
  • File list: AuditedCActiveRecord --- extend from this class if you want the subclass to be backed by the audit trail AuditTrail --- the model describing the audit trail table AuditTrailSequenceNumber --- the model describing the audit trail sequence table CustomCActiveRecord --- the base class for all models NestedCDbConnection --- creates/supports nested transactions NestedTransactionPDO --- creates/supports nested transactions
Config
  • Modify config/main.php -> db array to use class=>NestedCDbConnection
  • Import audit_schema.sql (MySQL)
Usage

For the required model, extend from AuditedCActiveRecord. Save/delete as per normal. If transactions are desired, use transactedSave/transactedDelete.

Classes which want to use transatedSave/transactedDelete must extend from CustomCActiveRecord.

Read the comments in the classes for more information!

Change Log

July 1, 2010
  • Initial release.
1 0
4 followers
746 downloads
Yii Version: 1.1
License: (not set)
Category: Database
Tags:
Developed by: Angelystor
Created on: Jul 1, 2010
Last updated: 14 years ago

Downloads

show all