ILIAS  Release_5_0_x_branch Revision 61816
 All Data Structures Namespaces Files Functions Variables Groups Pages
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

ilTermsOfServiceJsonResponse::__construct ( )

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

References initHttpBody().

{
$this->initHttpBody();
}

+ Here is the call graph for this function:

Member Function Documentation

ilTermsOfServiceJsonResponse::__toString ( )
Returns
string

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

References ilJsonUtil\encode(), and exit.

{
header("Content-type: application/json; charset=UTF-8");
echo ilJsonUtil::encode($this->body);
exit();
}

+ Here is the call graph for this function:

ilTermsOfServiceJsonResponse::initHttpBody ( )
protected

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

References STATUS_SUCCESS.

Referenced by __construct().

{
$this->body = new stdClass();
$this->body->status = self::STATUS_SUCCESS;
$this->body->body = '';
}

+ Here is the caller graph for this function:

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

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

References $body.

{
$this->body->body = $body;
}
ilTermsOfServiceJsonResponse::setStatus (   $status)
Parameters
int$status

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

{
$this->body->status = $status;
}

Field Documentation

ilTermsOfServiceJsonResponse::$body
protected

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

Referenced by setBody().

const ilTermsOfServiceJsonResponse::STATUS_FAILURE = 2
const ilTermsOfServiceJsonResponse::STATUS_SUCCESS = 1

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

Referenced by initHttpBody().


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