XF 2.2 finder with IN?

Just pass an array:

PHP:
$userFinder = $this->finder('XF:User')->where('username', ['Kier', 'Mike']);
 
Thank you. Have solved it with:

Code:
    public function findTeamsByIds($teamIds)
    {
        $db = \XF::db();
        return $this->db()->fetchAll("
            SELECT * FROM xf_lala_team WHERE team_id IN (".$db->quote($teamIds).")"
            );
    }

or

Code:
    public function findTeamsByIds($teamIds)
    {
        return $this->finder('Lala:Team')
        ->where('team_id', $teamIds);
    }
 
Last edited:
Back
Top Bottom