Return empty collection when ids is empty.

This commit is contained in:
李铭昕 2019-02-23 16:04:02 +08:00
parent 5a70f8ba3d
commit 1c1819eab4

View File

@ -97,6 +97,10 @@ class Manager
*/
public function findManyFromCache(array $ids, string $class): Collection
{
if (count($ids) === 0) {
return new Collection([]);
}
/** @var Model $instance */
$instance = new $class();