[Dbix-class] Refreshing object's data from database && row-level
locking
Marc Mims
marc at questright.com
Sat May 12 02:39:33 GMT 2007
* Oleg Pronin <syber.rus at gmail.com> [070511 18:30]:
> 1. Reloading
>
> I thought it would be great if DBIx::Class had this feature:
>
> sub reload {
> my ($self, $attrs) = @_;
>
> my $fresh_me = $self->result_source->resultset->find({
> map { $_ => $self->get_column($_) } $self->primary_columns,
> }, $attrs);
> $self->set_columns({$fresh_me->get_columns});
> 1;
> }
$obj->discard_changes;
http://search.cpan.org/~blblack/DBIx-Class-0.07006/lib/DBIx/Class/PK.pm
-Marc
More information about the Dbix-class
mailing list