/** * 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; }
/** * 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); }
/** * 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); }