ILIAS  release_5-3 Revision v5.3.23-19-g915713cf615
ilTermsOfServiceJsonResponse Class Reference

Let this class derive from a real http response class in future. More...

+ Collaboration diagram for ilTermsOfServiceJsonResponse:

Public Member Functions

 __construct ()
 
 setStatus ($status)
 
 setBody ($body)
 
 __toString ()
 

Data Fields

const STATUS_SUCCESS = 1
 
const STATUS_FAILURE = 2
 

Protected Member Functions

 initHttpBody ()
 

Protected Attributes

 $body
 

Detailed Description

Let this class derive from a real http response class in future.

Author
Michael Jansen mjans.nosp@m.en@d.nosp@m.ataba.nosp@m.y.de
Version
$Id$

Definition at line 11 of file class.ilTermsOfServiceJsonResponse.php.

Constructor & Destructor Documentation

◆ __construct()

ilTermsOfServiceJsonResponse::__construct ( )

Definition at line 24 of file class.ilTermsOfServiceJsonResponse.php.

References initHttpBody().

+ Here is the call graph for this function:

Member Function Documentation

◆ __toString()

ilTermsOfServiceJsonResponse::__toString ( )
Returns
string

Definition at line 58 of file class.ilTermsOfServiceJsonResponse.php.

References ilJsonUtil\encode(), exit, and header.

59  {
60  header("Content-type: application/json; charset=UTF-8");
61  echo ilJsonUtil::encode($this->body);
62  exit();
63  }
static encode($mixed, $suppress_native=false)
Add a drawing to the header
Definition: 04printing.php:69
+ Here is the call graph for this function:

◆ initHttpBody()

ilTermsOfServiceJsonResponse::initHttpBody ( )
protected

Definition at line 32 of file class.ilTermsOfServiceJsonResponse.php.

Referenced by __construct().

33  {
34  $this->body = new stdClass();
35  $this->body->status = self::STATUS_SUCCESS;
36  $this->body->body = '';
37  }
+ Here is the caller graph for this function:

◆ setBody()

ilTermsOfServiceJsonResponse::setBody (   $body)
Parameters
string$body

Definition at line 50 of file class.ilTermsOfServiceJsonResponse.php.

References $body.

51  {
52  $this->body->body = $body;
53  }

◆ setStatus()

ilTermsOfServiceJsonResponse::setStatus (   $status)
Parameters
int$status

Definition at line 42 of file class.ilTermsOfServiceJsonResponse.php.

43  {
44  $this->body->status = $status;
45  }

Field Documentation

◆ $body

ilTermsOfServiceJsonResponse::$body
protected

Definition at line 19 of file class.ilTermsOfServiceJsonResponse.php.

Referenced by setBody().

◆ STATUS_FAILURE

const ilTermsOfServiceJsonResponse::STATUS_FAILURE = 2

◆ STATUS_SUCCESS

const ilTermsOfServiceJsonResponse::STATUS_SUCCESS = 1

Definition at line 13 of file class.ilTermsOfServiceJsonResponse.php.


The documentation for this class was generated from the following file: