On Aug 2, 2006, at 1:47 PM, John Siracusa wrote: > * Add a has_loaded_related() helper method. +100
> You should never dereference an object as a hash in end-user code, and > you should only do so in your own RDBO-derived classes when dealing > with new attributes that you defined yourself in that same code. i meant to say these should work: >> if ( $rose_obj->namespace_for_objects ) { >> #do stuff >> } >> # don't have to check for existence >> foreach my $sub ( @{$rose_obj->namespace_for_objects'} ) { >> } the only way i was able to get code working was doing that. its not pretty, and i'll update it as soon as rose supports it-- but I needed to get some functionality into a project. > Null objects bother me because they imply something that may not be > true. For example, they might imply that foo has no bars, when really > foo's bars were merely not fetched by the Manager query that built > this object. (They may still exist in the database, however.) I only meant for null objects when with_loaded fetches nothing, but tried to fetch something -- not for marking the namespace on all gets. that shouldn't imply that anything that exists in the db isn't in the result set, any more than other parameters you stick into a manager subroutine ie ( please excuse pseudocode and me using hashes to convey this idea ) # current behavior my $results= get_items( with_objects=['a'] ); $results= { 'id'=> 1 'name=> 'jon' } # wanted behavior my $results2= get_items( with_objects=['a'] ); $results2= { 'id'=> 1 'name=> 'jon' a=>[ ] # one to many } $results2= { 'id'=> 1 'name=> 'jon' a=>{} # one to one } ------------------------------------------------------------------------- Take Surveys. Earn Cash. Influence the Future of IT Join SourceForge.net's Techsay panel and you'll get the chance to share your opinions on IT & business topics through brief surveys -- and earn cash http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV _______________________________________________ Rose-db-object mailing list Rose-db-object@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/rose-db-object