示例#1
0
文件: Json.php 项目: ysilvela/php-sdk
 /**
  * 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);
 }
示例#2
0
文件: Json.php 项目: ysilvela/php-sdk
 /**
  * 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));
 }