/**
  * The method by which the object is visited and is serialized
  * @param RequestInterface $object
  * @param Serializer $serializer
  * @return array Returns a formatted string such as json, post data from the object
  * @throws \Upg\Library\AbstractException Should throw exception if there is an error
  */
 public function visit(RequestInterface $object, Serializer $serializer)
 {
     $data = $object->getSerializerData();
     $data = $this->checkSerializeArray($data, $serializer);
     /**
      * Do not serialize the whole data instead return it as an array
      */
     return $data;
 }
Example #2
0
 /**
  * The method by which the object is visited and is serialized
  * @param RequestInterface $object
  * @param Serializer $serializer
  * @return string Returns a formatted string such as json, post data from the object
  * @throws \Upg\Library\AbstractException Should throw exception if there is an error
  */
 public function visit(RequestInterface $object, Serializer $serializer)
 {
     $data = $object->getSerializerData();
     $data = $this->checkSerializeArray($data, $serializer);
     return http_build_query($data);
 }
Example #3
0
 /**
  * The method by which the object is visited and is serialized
  * @param RequestInterface $object
  * @param Serializer $serializer
  * @return string Returns a formatted string such as json, post data from the object
  * @throws \Upg\Library\AbstractException Should throw exception if there is an error
  */
 public function visit(RequestInterface $object, Serializer $serializer)
 {
     $data = $object->getSerializerData();
     $data = $this->checkSerializeArray($data, $serializer);
     return json_encode($data);
 }