[CDBI] Best way to tell if two objects are the same?

[prev] [thread] [next] [Date index for 2006/01/11]

From: Bill Moseley
Subject: [CDBI] Best way to tell if two objects are the same?
Date: 14:29 on 11 Jan 2006
I need to know if $obj1 eq $obj2, and I'm wondering the best way.  I
suppose ref($obj1) eq ref($obj2) would fail without Live_Object index.

I notice the CDBI does this for the Live_Object index to build a key
for an object:

        my @primary_columns = $class->primary_columns;
        if (@primary_columns == grep defined, @{$data}{@primary_columns}) {

                # create single unique key for this object
                $obj_key = join "|", $class, map { $_ . '=' . $data->{$_} }
                        sort @primary_columns;
        }





        -- 
        Bill Moseley
moseley@xxxx.xxx


_______________________________________________
ClassDBI mailing list
ClassDBI@xxxxx.xxxxxxxxxxxxxxxx.xxx
http://lists.digitalcraftsmen.net/mailman/listinfo/classdbi

[CDBI] Best way to tell if two objects are the same?
Bill Moseley 14:29 on 11 Jan 2006

Generated at 09:31 on 23 Jan 2006 by mariachi v0.52