In direct reply to my previous email. I found one possible solution:
sub insert {
my( $self, @rest ) = @_;
# run the other components (and let PK::Auto do its work)
my $ret = $self->next::method( @rest );
# now add the audit trail with the PK ...
}
Works great! Any problems with this?
Tobias
Zitat von Tobias Kremer <[EMAIL PROTECTED]>:
> 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(?)
_______________________________________________
List: http://lists.rawmode.org/cgi-bin/mailman/listinfo/dbix-class
Wiki: http://dbix-class.shadowcatsystems.co.uk/
IRC: irc.perl.org#dbix-class
SVN: http://dev.catalyst.perl.org/repos/bast/trunk/DBIx-Class/
Searchable Archive: http://www.mail-archive.com/[email protected]/