Bluz\Db\Table::find
Fetches rows by primary key. The argument specifies one or more primary key value(s). To find multiple rows by primary key, the argument must be an array.
This method accepts a variable number of arguments. If the table has a multi-column primary key, the number of arguments must be the same as the number of columns in the primary key. To find multiple rows in a table with a multi-column primary key, each argument must be an array with the same number of elements. The find() method always returns a array Row by primary key, return array Table::find(123); Row by compound primary key, return array Table::find([123, 'abc']); Multiple rows by primary key Table::find(123, 234, 345); Multiple rows by compound primary key Table::find([123, 'abc'], [234, 'def'], [345, 'ghi'])
Signature
public function find(
$keys )
Parameters
$keys
—
Returns
- array
Errors/Exceptions
-
InvalidPrimaryKeyException
- if wrong count of values passed