[Dbix-class] join ON *AND*

Carl Franks fireartist at gmail.com
Fri Feb 21 09:28:48 GMT 2014


On 21 February 2014 09:22, Hartmaier Alexander
<alexander.hartmaier at t-systems.at> wrote:
> Just restrict the resultset:
> ->search({
>     'response_comments.alert' => 1,
>     'response_comments.status => 'posted',
> }, {
> ...
> });
>

Hi,
Thanks for the response.
Unfortunately, that adds the clause after a "WHERE", which causes it
to only return queries which have a related response_comment - e.g.
id | title | count(response_comment.id)
---------------------------------------
 2 | two   | 1
- it doesn't return any rows where count=0.

I'm looking at the docs now for add_relationship() - I'm wondering
whether I need to create a new relationship which contains the AND
clauses.

Carl



More information about the DBIx-Class mailing list