Posted on behalf of Jonathan Vanasco...
------ Forwarded Message
From: Jonathan <[EMAIL PROTECTED]>
Date: Fri, 21 Jul 2006 19:49:22 -0400
To: <[EMAIL PROTECTED]>
Subject: Where / Or question for manager class
I hate asking for this- but my idiot email provider just got rbl'd ,
so my list posts are being bounced.
Would you mind posting this to the RDBO list for me?
======
Subject: Where / Or question for manager class
I've got a manager function that works- i just want to make sure that
its working in a standard manner (read, not magical but expected )
essentially, what i'm worried about, is that
type_id
can either be singular or plural (or) { though i imagine an and case
would be similar }
i'm just creating a hash for or , and stuffing everything in there
i guess in a 'proper' setup, i should see if i'm handling 1 item or
multiple items, and either do a single limiter or 'or' limiter
depending on the case. but i was in a rush, and this wild guess got
me the same result.
---
package myManager;
sub user_search {
my ( $class, %args )= @_ ;
my @ors;
foreach my $_or ( @{$args{'type_id'}} ) {
push @or , { 'type_id'=> $_or };
}
my $results= $class->get_useraccount_findmeon(
query=> [
resource=> $args{resource} ,
is_deleted=> 0,
where=> [
'or'=> [EMAIL PROTECTED]
]
],
db=> $args{db}
);
return $results;
}
package caller;
my @types;
if ( 1 )
{
push @types , $type_id;
}
eval {
$obj= FindMeOn::RoseDB::Object::Useraccount::Manager->user_search(
resource=> $searchtext ,
type_id => [EMAIL PROTECTED],
db=> $self->make__rose_db_obj($self->{'__DB'}{'DBH'}) ,
);
};
----
------ End of Forwarded Message
-------------------------------------------------------------------------
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
[email protected]
https://lists.sourceforge.net/lists/listinfo/rose-db-object