John Siracusa wrote:
> 
> 
> On 7/29/06 3:53 PM, Kurt Hansen wrote:
>

A little behind on my reading, sorry for the late post...

[snip]

Should this possibly be added to the tutorial? I haven't located this
little tidbit anywhere in the docs (other than the method map) and it
seems like it would be a common enough issue to include in the tut. I
know I ran across the issue and settled for grabbing the whole old list
and then just reseting the whole thing again which I really wanted to
avoid but didn't know how. By at least providing a simple short example
in the main object docs or the tutorial one would know to look for
further evidence that the feature exists. If it is in the docs already,
sorry for overlooking it.

Just my couple of cents,

http://danconia.org

> If what you really want to do is
> *add* to the list of Person objects, use either the "add_now" or
> "add_on_save" methods of the one-to-many relationship.  The "add_on_save"
> method type is part of the default_auto_method_types for the OneToMany
> relationship, so I'll use that one:
> 
>     $b = Basket->new(...);
>     $p1 = Person->new(...);
>     $p2 = Person->new(...);
> 
>     # Set the entire list of associated Person objects for the
>     # Basket object $b to consist of the lone Person object $p1
>     $b->persons($p1);
>     $b->save; # db updated here
> 
>     # Add $p2 to the list of Person objects associated with
>     # the Basket object $b.
>     $b->add_persons($p2);
>     $b->save; # db updated here
> 
> For more information on the methods created for each relationship, look at
> the "method map" section of the relationship docs and follow the links to
> the descriptions of the actual methods:
> 

-------------------------------------------------------------------------
Using Tomcat but need to do more? Need to support web services, security?
Get stuff done quickly with pre-integrated technology to make your job easier
Download IBM WebSphere Application Server v.1.0.1 based on Apache Geronimo
http://sel.as-us.falkag.net/sel?cmd=lnk&kid=120709&bid=263057&dat=121642
_______________________________________________
Rose-db-object mailing list
Rose-db-object@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/rose-db-object

Reply via email to