Welcome Guest, Not a member yet? Register   Sign In
Datamapper: Something like where_in_related, but including all
#3

[eluser]avramovic[/eluser]
OK, I'm looking like lunatic replying to myself constantly, but here's how I've done it, in case someone else needs similar functionality:

Code:
$results->where_in_related_amenity('id', $am_ids);
$results->group_by('id');
$results->having('COUNT(DISTINCT `'.$this->db->dbprefix.'amenities_properties`.`amenity_id`) =', count($am_ids), false);


Messages In This Thread
Datamapper: Something like where_in_related, but including all - by El Forum - 05-29-2013, 06:26 AM



Theme © iAndrew 2016 - Forum software by © MyBB