/** * Serializes the order collection into JSON. * * @param NostoOrderCollection $collection the collection to serialize. * @return string the JSON. */ public function serialize(NostoOrderCollection $collection) { $data = array(); $productSerializer = new NostoOrderSerializerArray(); foreach ($collection->getArrayCopy() as $order) { $data[] = $productSerializer->serialize($order); } return json_encode($data); }
/** * Serializes the order into an json structure. * * @param NostoOrderInterface $order the order to serialize. * @return string the serialized data. */ public function serialize(NostoOrderInterface $order) { $serializer = new NostoOrderSerializerArray(); return json_encode($serializer->serialize($order)); }