[Dbix-class] Rows

Patrick Meidl patrick at pantheon.at
Fri Jul 27 09:21:54 GMT 2012


On Fri, Jul 27 2012, Erik Colson <eco at ecocode.net> wrote:

> How can I check if the contents of 2 Row Objects are identical ?  I'm
> used to create a function to check the individual fields, but maybe
> DBIx::Class is smarter on this ?

in ORM, identity is usually defined by having the same primary key. if
you maniplulate your objects after fetching them from the database,
though, you will have to do dirty checking (i.e. check if any columns
were changed in the detached object). you can use e.g. $row->is_changed
for this, see

http://search.cpan.org/~frew/DBIx-Class-0.08198/lib/DBIx/Class/Row.pm#is_changed

HTH

    patrick

-- 
Patrick Meidl ........................ patrick at pantheon.at
Vienna, Austria ...................... http://gplus.to/pmeidl




More information about the DBIx-Class mailing list