Hi,
I'm moderately new to R:D:O - so I just want to sanity check that the
following is reasonable / idiomatic.
I've got a whole mess-o-tables that (by and large)
Rose::DB::Object::Loader deals with splendidly. However, there are a
few columns where I would like to do a little client-side stuff
before I update a column in an object. At the moment I'm doing
something like this when I set up the classes with R:D:O:L
Rose::DB::Object::Loader->new(
db => MyApp::DB->new,
class_prefix => 'MyApp'
)->make_classes(
pre_init_hook => sub {
my $meta = shift;
$meta->column( 'some_column' )->alias( '_some_column' )
if $meta->table eq 'some_table';
}
);
then off in MyApp::SomeTable I do:
sub some_column {
my $self = shift;
# ...stuff I need to do before changing value goes here...
return $self->_some_column( @_ );
}
Reasonable? Is there a better way (for some definition of "better")?
Cheers,
Adrian
-------------------------------------------------------------------------
Take Surveys. Earn Cash. Influence the Future of IT
Join SourceForge.net's Techsay panel and you'll get the chance to share your
opinions on IT & business topics through brief surveys-and earn cash
http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV
_______________________________________________
Rose-db-object mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/rose-db-object