[Dbix-class] adding conditions

Octavian Rasnita orasnita at gmail.com
Tue Jan 9 15:01:43 GMT 2007


Hi,

I have a code like:

my $rs = $c->model("Db::Forum")->search({
id_room => 1,
},
{
join => "id_user",
prefetch => "id_user",
rows => 20,
order_by => 'date desc, time desc',
page => 1,
});

I want to add some conditions to this query like:

id_user => $id_user,

How can I add these conditions after defining $rs?

For example I want to add them based on some other conditions like

if ($id_user) {
#Add the condition id_user => $id_user,
}

Thank you.

Octavian




More information about the Dbix-class mailing list