nocte Well-known member Feb 13, 2018 #1 There is a method whereIds(array $ids) in the XF\Mvc\Entity\Finder class. It makes a SQL statement like WHERE entity_id IN (1, 2, 3, 4) Why is there no whereIdsNot() method or an equivalent? I would like to build something like WHERE entity_id NOT IN (1, 2, 3, 4)
There is a method whereIds(array $ids) in the XF\Mvc\Entity\Finder class. It makes a SQL statement like WHERE entity_id IN (1, 2, 3, 4) Why is there no whereIdsNot() method or an equivalent? I would like to build something like WHERE entity_id NOT IN (1, 2, 3, 4)
Chris D XenForo developer Staff member Feb 13, 2018 #2 whereIds() is just a shortcut for: PHP: $finder->where('some_primary_key', '=', [1, 2, 3, 4])->fetch(); So you can just do: PHP: $finder->where('some_primary_key', '!=', [1, 2, 3, 4])->fetch();
whereIds() is just a shortcut for: PHP: $finder->where('some_primary_key', '=', [1, 2, 3, 4])->fetch(); So you can just do: PHP: $finder->where('some_primary_key', '!=', [1, 2, 3, 4])->fetch();