I have a database with many-to-many relations on tag and person. I am in trouble when tried to search a person with multiple tags. I tried this but its fail:
$person = Doctrine_Query::create()
->from("Model_Person p")
->innerJoin("p.tags t")
->whereIn('t.id',$t)
->execute();
The above statement return all persons that have at least one of the tags in array $t, but I want only person that havel 'all' the tags on that array.
Anyone know how to achieve this ?
Thanks