Exemplo n.º 1
0
 /**
  * Returns an instance for a request which is
  * JSON-formatted
  * @return \static
  */
 public static function get()
 {
     $req = new static();
     $post = \file_get_contents('php://input');
     if ($post !== false) {
         $obj = Json::deserialise($post);
         if ($obj !== null) {
             $req->_Obj = $obj;
         }
     }
     return $req;
 }
Exemplo n.º 2
0
 /**
  * Serialises $this to a JSON string
  * @return string
  */
 public function serialise()
 {
     return Json::serialise($this);
 }
Exemplo n.º 3
0
 /**
  * Formats the current object to a JSON-formatted string
  * IMPORTANT! This will serialise all public properties
  * @return string
  */
 public function toJsonString()
 {
     return Json::serialise($this);
 }
Exemplo n.º 4
0
 /**
  * Assigns the JSON string properties to $this
  * @param string $content
  */
 public function deserialise($content)
 {
     $this->Data = Json::deserialise($content);
 }