Skip to content

Commit 6e1335b

Browse files
authored
$myModel->find(string "value-of-my-primary-key") #1188
adding string as allowed primary key; in current state if you pass string to find method you will get all records instead of desired one.
1 parent 85588b1 commit 6e1335b

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

system/Model.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -326,7 +326,7 @@ public function find($id = null)
326326
->get();
327327
$row = $row->getResult($this->tempReturnType);
328328
}
329-
elseif (is_numeric($id))
329+
elseif (is_numeric($id) || is_string($id))
330330
{
331331
$row = $builder->where($this->table.'.'.$this->primaryKey, $id)
332332
->get();

0 commit comments

Comments
 (0)