/** * @param VisitorInterface $visitor * @param ModelCollection $collection * @param array $type * @param Context $context * * @return mixed */ public function serializeCollection(VisitorInterface $visitor, ModelCollection $collection, array $type, Context $context) { $type['name'] = 'array'; return $visitor->visitArray($collection->toArray(), $type, $context); }