Fixed issue where Model was dying if only passed an integer (presumably the ID of a row)
This commit is contained in:
parent
005d30497e
commit
7cf3e5dadf
1 changed files with 3 additions and 2 deletions
|
@ -265,11 +265,11 @@ class Model extends Object
|
|||
$this->generateQuery();
|
||||
}
|
||||
// Pulls by ID
|
||||
elseif (is_int($type_or_parameters))
|
||||
elseif (ctype_digit($type_or_parameters))
|
||||
{
|
||||
$this->sql[] = 'WHERE ' . $this->id . ' = :' . $this->id . ' LIMIT 1;';
|
||||
|
||||
$this->input_parameters = array($this->id => $parameters);
|
||||
$this->input_parameters = array($this->id => $type_or_parameters);
|
||||
}
|
||||
else
|
||||
{
|
||||
|
@ -292,6 +292,7 @@ class Model extends Object
|
|||
|
||||
// Throws an error
|
||||
default:
|
||||
print_r($this->sql);
|
||||
throw new Exception('Unknown query type');
|
||||
break;
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue