Stud.IP  6.1
Information Class Reference
Inheritance diagram for Information:
EnrolmentInformation

Public Member Functions

 __construct (string $message='', int $type=Information::INFO, string $codeword='', ?\Range $range=null)
 
 getMessage ()
 
 setMessage (string $message)
 
 getType ()
 
 setType (int $type)
 
 getCodeword ()
 
 setCodeword (string $codeword)
 
 getRange ()
 
 setRange (\Range $range)
 
 __toString ()
 
 toMessageBox (bool $verbose=false)
 

Data Fields

const INFO = 0
 
const WARNING = 1
 
const ERROR = 2
 

Protected Attributes

int $type = Information::INFO
 
string $codeword
 
string $message
 
Range $range = null
 

Detailed Description

The Information class represents an information from the internals of Stud.IP that shall be displayed to the user, but not necessarily right away in the form of an exception or a simple piece of text. The information class allows the use of codewords (error codes) and to indicate whether the information is just of informative character, a warning or an error.

Constructor & Destructor Documentation

◆ __construct()

__construct ( string  $message = '',
int  $type = Information::INFO,
string  $codeword = '',
?\Range  $range = null 
)

Member Function Documentation

◆ __toString()

__toString ( )

Generates a string representation of the information.

Returns
string The string representation of the information.

◆ getCodeword()

getCodeword ( )

◆ getMessage()

getMessage ( )

◆ getRange()

getRange ( )

◆ getType()

getType ( )

◆ setCodeword()

setCodeword ( string  $codeword)

◆ setMessage()

setMessage ( string  $message)

◆ setRange()

setRange ( \Range  $range)

◆ setType()

setType ( int  $type)

◆ toMessageBox()

toMessageBox ( bool  $verbose = false)

Generates a Stud.IP message box for the information.

Parameters
$verbosebool Whether to include the codeword (true) or not (false). Defaults to false.
Returns
The generated message box for the information.

Field Documentation

◆ $codeword

string $codeword
protected

◆ $message

string $message
protected

◆ $range

Range $range = null
protected

◆ $type

int $type = Information::INFO
protected

◆ ERROR

const ERROR = 2

◆ INFO

const INFO = 0

◆ WARNING

const WARNING = 1

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