interface Plex_ExceptionInterface

Interface that defines the structure of Plex exceptions.

Methods

boolean
isValidType(string $type)

Makes sure the type of exception being thrown is valid for the module trying to throw the exception.

integer
getCodeForType(string $type)

Every valid exception type should have an HTTP code with which it is associated. This method brings back said code for the given exception type.

string
getMessageForType(string $type, mixed[] $params)

Every valid exception type should have a message with which it is associated. This method brings back said message for the given exception type.

mixed[]
getValidTypes()

Module specific exceptions will have a defined set of exception types they are allowed to throw. This method will list the valid exception types for the instantiated exception class.

Details

at line 49
boolean isValidType(string $type)

Makes sure the type of exception being thrown is valid for the module trying to throw the exception.

Parameters

string $type The type of exception being thrown.

Return Value

boolean Whether or not the type of exception being thrown is valid for the module trying to throw the exception.

at line 60
integer getCodeForType(string $type)

Every valid exception type should have an HTTP code with which it is associated. This method brings back said code for the given exception type.

Parameters

string $type The type of exception being thrown.

Return Value

integer The HTTP code for the given exception type.

at line 75
string getMessageForType(string $type, mixed[] $params)

Every valid exception type should have a message with which it is associated. This method brings back said message for the given exception type.

Parameters

string $type The type of exception being thrown.
mixed[] $params An array of values that will fill in variables in the message. This is used for exception messages that can not be static.

Return Value

string The message of the exception being thrown. If parameters were passed and correclty correlated, the variables in the message will be properly filled in.

at line 85
mixed[] getValidTypes()

Module specific exceptions will have a defined set of exception types they are allowed to throw. This method will list the valid exception types for the instantiated exception class.

Return Value

mixed[] Associative array of exception types for the instantiated exception class.