This extension logs with every created or updated row in your database who created and who updated it. This may interest you when working in a group of more people sharing same privileges.
So you can see who changed what record set and - in combination with the timestampable behavior - when.
Copyright (c) 2010 mintao GmbH & Co. KG
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in
all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
THE SOFTWARE.
Requirements
Installation
- Extract the release file under
components/behaviors or just components, it's on you.
- Create two extra comlumns for each table you want to track. Default column names are
created_by and updated_by. Column type should be varchar(128)
- Add this behavior to your desired model:
Usage
See the following code example:
public function behaviors()
{
return array(
'Blameable' => array(
'class'=>'application.components.behaviors.BlameableBehavior',
),
);
}
If you want to define own column names, just add them in the behaviors method like this:
public function behaviors()
{
return array(
'Blameable' => array(
'class'=>'application.components.behaviors.BlameableBehavior',
'createdByColumn' => 'my_own_creator_column_name',
'updatedByColumn' => 'my_own_updater_column_name',
),
);
}
PLEASE MENTION to change the class attribute to where you located this little behavior. So the above examples only work, if you created an extra behaviors folder in your components directory (as I did).