修正集合类

This commit is contained in:
yunwuxin
2016-07-11 10:23:20 +08:00
parent f46c337b34
commit e1406b969b

View File

@@ -42,7 +42,7 @@ class Collection implements ArrayAccess, Countable, IteratorAggregate, JsonSeria
public function toArray($allow = []) public function toArray($allow = [])
{ {
return array_map(function ($value) { return array_map(function ($value) use ($allow) {
return ($value instanceof Model || $value instanceof self) ? $value->toArray($allow) : $value; return ($value instanceof Model || $value instanceof self) ? $value->toArray($allow) : $value;
}, $this->items); }, $this->items);
} }