Welcome Guest, Not a member yet? Register   Sign In
How can I use findAll with select in model?
#3

find()
Returns a single row where the primary key matches the value passed in as the first parameter:
$user = $userModel->find($user_id);

The value is returned in the format specified in $returnType.
You can specify more than one row to return by passing an array of primaryKey values instead of just one:
$users = $userModel->find([1,2,3]);

If no parameters are passed in, will return all rows in that model’s table, effectively acting like findAll(), though less explicit.


Please read the docs.
Reply


Messages In This Thread
RE: How can I use findAll with select in model? - by nurmyrat - 04-08-2021, 12:07 AM



Theme © iAndrew 2016 - Forum software by © MyBB