Yii: Created and Updated, Who and When

Most data have created_date, created_by, updated_date and updated_by columns to audit records. in Yii, these columns can be automatically updated via these 2 behaviors: CTimestampBehavior – a standard zii behavior that is distributed with yii BlameableBehavior – a user contributed extension. Download from this page and unzip to /path/to/components/behaviors Edit /path/to/models/<Model>.php and add / edit…

Continue Reading »

Symfony: Hacking sfDoctrineActAsSignablePlugin to allow updated and created by specific user

I’m using sfDoctrineActAsSignablePlugin (V1.0.0) to audit record creation and updates. ie fields created_by and updated_by are automatically created and updated. This is perfect when running from browsers. But when running as command line such as loading initial data (via symfony doc:build –all –and-load) or customized task to import data, the fields are set to null….

Continue Reading »

Symfony: created_by and updated_by columns

These columns are required for most tables to sign the data. However the save codes are repeated through out the model classes. Code repetition is bad programming practice. This is where sfDoctrineActAsSignablePlugin comes to rescue! Once plugin is installed, just add this to schema.yml to automatically add created_by and updated_by columns: