Skip to content
This repository has been archived by the owner on Jul 16, 2023. It is now read-only.

Commit

Permalink
Fixing memory exhaustion in find()
Browse files Browse the repository at this point in the history
Closes #283 and #191
  • Loading branch information
igorsantos07 committed Nov 30, 2015
1 parent 49ef00d commit f6ad904
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/Ardent/Ardent.php
Original file line number Diff line number Diff line change
Expand Up @@ -908,7 +908,8 @@ public static function find($id, $columns = array('*')) {
if (static::$throwOnFind && $debug[1]['function'] != 'findOrFail') {
return self::findOrFail($id, $columns);
} else {
return parent::find($id, $columns);
//mimicking Eloquent's __callStatic() + __call() behaviour so we don't loop forever
return (new static)->__call('find', [$id, $columns]);
}
}

Expand Down

0 comments on commit f6ad904

Please sign in to comment.