[Dbix-class] Audit Trails/History Component

Brian Cassidy brian.cassidy at nald.ca
Thu Aug 31 15:15:21 CEST 2006


Tobias,

Tobias Kremer wrote:
> Basically I'm overriding the insert, update and delete methods in my component.
> Unfortunately PK::Auto's insert method first calls the other components in the
> chain (as far as i understand this whole overriding-next-c3-fu) and then
> retrieves a new primary key if none is already given. This leads to the
> problem that my component needs a primary key to make a reference in the
> audit trail/history table to the modified record but it's not there because
> PK::Auto delays the fetching of a new primary key value until all other
> components were run(?)
>   
Having done something similar, be aware that your "reference" to the id 
should be an actual foreign key. Try to delete a row and you'll see what 
i mean. :)

-Brian



More information about the Dbix-class mailing list