On 2/6/07, Derek Watson <[EMAIL PROTECTED]> wrote: > That was pretty much my position, too -- I was looking for something more > semantically appropriate. My task was trivial to solve in one or two ways, I > just didn't see any examples on how to do this stuff elegantly. What I am > really looking for is something expressive like > > $product->find_prices(query => [ region => 'UK' ])->delete_all;
How about a delete_now method type for 1-to-m relationships (same arg formats as the "find" method type): $product->delete_prices({ region => 'UK' }); I'm not a big fan of the *_now method types, however, which is why they're not the defaults. OTOH, a delete_on_save method might seem strange when doing something like this: $product->delete_prices({ region => 'UK' }); # delete_on_save Then fetch the prices and see the UK price(s) still there: @prices = $product->prices; all because you haven't yet said: $product->save; To actually execute the delete. Like "find", this kind of method seems like a shortcut to a Manager call. So it should probably execute immediately, and it's probably entirely outside the scope of the "collection" methods for get/set/add. Anyone have any better ideas? :) -John ------------------------------------------------------------------------- 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