Quick $obj->delete qn where obj has multiple primary keys

[prev] [thread] [next] [Date index for 2005/06/30]

From: Andrew O'Brien
Subject: Quick $obj->delete qn where obj has multiple primary keys
Date: 02:28 on 30 Jun 2005
Hi all,

I'm playing with CDBI 0.96 and I was under the impression that
->delete() would do the right thing when called on objects with multiple
primary keys. Admittedly this is mostly because there is nothing in the
docs I can find to tell me otherwise :)

(Yes, I'll get started testing with the version 0.999 posted by Tony
soon but there wasn't anything that jumped out at me in the changelog so
it hasn't been a priority)

I have a number of link tables for many-to-many relationships in my data
and when managing the links I have something that once boiled down does:

$o =3D $linkclass->retrieve( pk1 =3D> pk1value, pk2 =3D> pk2value );
# dump object
$o->delete();
# dump object

Looking at the object dump as it passes through the logic in the page it
does indeed become an empty 'Class::DBI::Object::Has::Been::Deleted'
object but the data is still in the database.

If this is something that I have to do manually then so be it. I'll even
send in a patch for the docs!

If not, what am I doing wrong? (or what could be going wrong that CDBI
may not be telling me?)


-andrew

Quick $obj->delete qn where obj has multiple primary keys
Andrew O'Brien 02:28 on 30 Jun 2005

Generated at 16:37 on 28 Jul 2005 by mariachi v0.52