Possible fix for issue #378.
Signed-off-by: Jason Lewis <jason.lewis1991@gmail.com>
This commit is contained in:
parent
4b49ae422c
commit
ab2fcb84ef
|
@ -230,11 +230,9 @@ public static function update($id, $attributes)
|
||||||
* @param array $columns
|
* @param array $columns
|
||||||
* @return Model
|
* @return Model
|
||||||
*/
|
*/
|
||||||
public static function find($id, $columns = array('*'))
|
public function _find($id, $columns = array('*'))
|
||||||
{
|
{
|
||||||
$model = new static;
|
return $this->query()->where(static::$key, '=', $id)->first($columns);
|
||||||
|
|
||||||
return $model->query()->where(static::$key, '=', $id)->first($columns);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -749,7 +747,7 @@ public function __call($method, $parameters)
|
||||||
// Some methods need to be accessed both staticly and non-staticly so we'll
|
// Some methods need to be accessed both staticly and non-staticly so we'll
|
||||||
// keep underscored methods of those methods and intercept calls to them
|
// keep underscored methods of those methods and intercept calls to them
|
||||||
// here so they can be called either way on the model instance.
|
// here so they can be called either way on the model instance.
|
||||||
if (in_array($method, array('with')))
|
if (in_array($method, array('with', 'find')))
|
||||||
{
|
{
|
||||||
return call_user_func_array(array($this, '_'.$method), $parameters);
|
return call_user_func_array(array($this, '_'.$method), $parameters);
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue