Re: [CDBI] delete from lookup table
[prev]
[thread]
[next]
[Date index for 2005/10/26]
On 10/25/05, WulfDirk.Leuschner@xxxxxxxxxxxxxx.xxx
<WulfDirk.Leuschner@xxxxxxxxxxxxxx.xxx> wrote:
>
>
> Hi all,
>
> is there a method that deletes entries from a lookup table in a many-to-m=
any
> relationship? Some autogenerated method similar to 'add_to_<my_method>
> [which could be called 'remove_from_<my_method>]?
>
What i have seen a lot is is the use or "delete_all" on the results
from a search.
$class->search( id =3D> $related_id)->delete_all;
and if a "my_method" is a has_many accessor i think you can say;
$self->my_method(id =3D> $id)->delete_all;
I'm not sure if has_many method will return an iterator in scalar
context or not.
HTH
--
pjs
_______________________________________________
ClassDBI mailing list
ClassDBI@xxxxx.xxxxxxxxxxxxxxxx.xxx
http://lists.digitalcraftsmen.net/mailman/listinfo/classdbi
|
|
Re: [CDBI] delete from lookup table
Peter Speltz 19:27 on 26 Oct 2005
|