Re: Possible imrovement to Class::DBI::retrieve

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

From: Cees Hek
Subject: Re: Possible imrovement to Class::DBI::retrieve
Date: 03:38 on 10 Jun 2005
On 6/9/05, leif.eriksen@xxx.xxx.xx <leif.eriksen@xxx.xxx.xx> wrote:
> my $item =3D Item->create({Id=3D>1, Area=3D>'Vic', Box=3D>$box}); #$box->=
isa('Box'), not a simple scalar

Try it this way:

my $item =3D $box->add_to_items({Id=3D>1, Area=3D>'Vic'});=20

The add_to_items is automatically created for you when you setup a
has_many relationship.  It will automatically fill in the foreign key
for you.

Cheers,

Cees

Possible imrovement to Class::DBI::retrieve
leif.eriksen 02:10 on 10 Jun 2005

Re: Possible imrovement to Class::DBI::retrieve
Cees Hek 03:38 on 10 Jun 2005

Re: Possible imrovement to Class::DBI::retrieve
William Ross 09:26 on 10 Jun 2005

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