You can do it exactly as you've done it in the past. Add a new method to the model and call it. The new models basically take a lot of the functionality that many of the publicly available MY_Model classes had and build them into the core.
The reason that query is giving you errors is because you're treating the
table() call like a
select call, which it isn't. The table method just specifies which table to use. This is necessary in 4 to keep queries from "bleeding" into other queries as would often happen in CI3 if you weren't very careful.
PHP Code:
$this->db->table('users')...
However, you also have some helper functions in your model you can use now for that same query.
PHP Code:
public function checkLoginCredentials($username, $password) {
$user = $this->where('username', $username)->first();
if ($user === null) {
return false;
}
... check password stuff here...
}