Constants

INLINEERROR_AGENT

INLINEERROR_AGENT

Name of BottomlevelAgent for showing inline errors

Properties

$subAgents

$subAgents : array

SubAgents

Type

array

$request

$request : \hhu\z\agents\Request

Current request

Type

\hhu\z\agents\Request

$response

$response : \hhu\z\agents\Response

Current response

Type

\hhu\z\agents\Response

Methods

load()

load(string  $questtypeName) 

Load a QuesttypeAgent.

Parameters

string $questtypeName

Name of the QuesttypeAgent to load

Throws

\hhu\z\agents\QuesttypeAgentNotFoundException
\hhu\z\agents\QuesttypeAgentNotValidException

factory()

factory(string  $questtypeName, \hhu\z\agents\Request  $request, \nre\core\Response  $response, \hhu\z\agents\Logger  $log = null) 

Instantiate a QuesttypeAgent (Factory Pattern).

Parameters

string $questtypeName

Name of the QuesttypeAgent to instantiate

\hhu\z\agents\Request $request

Current request

\nre\core\Response $response
\hhu\z\agents\Logger $log

Log-system

Throws

\hhu\z\agents\DatamodelException
\hhu\z\agents\DriverNotValidException
\hhu\z\agents\DriverNotFoundException
\hhu\z\agents\ViewNotFoundException
\hhu\z\agents\QuesttypeModelNotValidException
\hhu\z\agents\QuesttypeModelNotFoundException
\hhu\z\agents\QuesttypeControllerNotValidException
\hhu\z\agents\QuesttypeControllerNotFoundException

run()

run(\nre\core\Request  $request, \nre\core\Response  $response) : \nre\core\Exception

Run the Controller of this Agent and its SubAgents.

Parameters

\nre\core\Request $request

Current request

\nre\core\Response $response

Current response

Throws

\nre\core\ParamsNotValidException
\nre\core\IdNotFoundException
\nre\core\DatamodelException
\nre\core\ActionNotFoundException

Returns

\nre\core\Exception

Last occurred exception of SubAgents

render()

render(array  $data = array()) : string

Generate output of the Controller of this Agent and its SubAgents.

Parameters

array $data

View data

Returns

string —

Generated output

checkClass()

checkClass(string  $className, string  $parentClassName) 

Check inheritance of the QuesttypeAgent-class.

Parameters

string $className

Name of the class to check

string $parentClassName

Name of the parent class

Throws

\hhu\z\agents\ClassNotValidException

saveAnswersOfCharacter()

saveAnswersOfCharacter(array  $seminary, array  $questgroup, array  $quest, array  $character, array  $answers) 

Save the answers of a Character for a Quest.

Parameters

array $seminary

Current Seminary data

array $questgroup

Current Questgroup data

array $quest

Current Quest data

array $character

Current Character data

array $answers

Character answers for the Quest

matchAnswersOfCharacter()

matchAnswersOfCharacter(array  $seminary, array  $questgroup, array  $quest, array  $character, array  $answers) 

Check if answers of a Character for a Quest match the correct ones.

Parameters

array $seminary

Current Seminary data

array $questgroup

Current Questgroup data

array $quest

Current Quest data

array $character

Current Character data

array $answers

Character answers for the Quest

__construct()

__construct(\hhu\z\agents\Request  $request, \nre\core\Response  $response, \hhu\z\agents\Logger  $log = null) 

Construct a new QuesttypeAgent.

Parameters

\hhu\z\agents\Request $request

Current request

\nre\core\Response $response
\hhu\z\agents\Logger $log

Log-system

Throws

\hhu\z\agents\DatamodelException
\hhu\z\agents\DriverNotValidException
\hhu\z\agents\DriverNotFoundException
\hhu\z\agents\ViewNotFoundException
\hhu\z\agents\ModelNotValidException
\hhu\z\agents\ModelNotFoundException
\hhu\z\agents\QuesttypeModelNotValidException
\hhu\z\agents\QuesttypeModelNotFoundException
\hhu\z\agents\QuesttypeControllerNotValidException
\hhu\z\agents\QuesttypeControllerNotFoundException

actionConstruct()

actionConstruct() 

Construct SubAgents (per Action).

loadController()

loadController() 

Load the Controller of this Agent.

Throws

\hhu\z\agents\DatamodelException
\hhu\z\agents\DriverNotValidException
\hhu\z\agents\DriverNotFoundException
\hhu\z\agents\ViewNotFoundException
\hhu\z\agents\ModelNotValidException
\hhu\z\agents\ModelNotFoundException
\hhu\z\agents\QuesttypeModelNotValidException
\hhu\z\agents\QuesttypeModelNotFoundException
\hhu\z\agents\QuesttypeControllerNotValidException
\hhu\z\agents\QuesttypeControllerNotFoundException

log()

log(\nre\core\Exception  $exception, integer  $logMode) 

Log an error.

Parameters

\nre\core\Exception $exception

Occurred exception

integer $logMode

Log mode

addSubAgent()

addSubAgent(string  $agentName) 

Load a SubAgent and add it.

Parameters

string $agentName

Name of the Agent to load

Throws

\nre\core\ServiceUnavailableException
\nre\core\AgentNotFoundException
\nre\core\AgentNotValidException

_addSubAgent()

_addSubAgent(string  $agentName) 

Load a SubAgent and add it.

Parameters

string $agentName

Name of the Agent to load

Throws

\nre\core\ServiceUnavailableException
\nre\core\DatamodelException
\nre\core\AgentNotFoundException
\nre\core\AgentNotValidException

getAgentType()

getAgentType() : string

Determine the type of an Agent.

Returns

string —

Agent type

getClassName()

getClassName(string  $questtypeName, string  $agentType = null) : string

Determine the Agent-classname for the given Questtype-name.

Parameters

string $questtypeName

Questtype-name to get Agent-classname of

string $agentType

Agent type of given Agent name

Returns

string —

Classname for the Questtype-name

newSubAgent()

newSubAgent(string  $agentName) : array

Create a new SubAgent.

Parameters

string $agentName

Agent name

Throws

\nre\core\DatamodelException

Returns

array —

SubAgent

renderSubAgent()

renderSubAgent(array  $subAgent) : string

Render a SubAgent.

Parameters

array $subAgent

SubAgent to render

Returns

string —

Generated output

errorInline()

errorInline(  $subAgent,   $request, \nre\core\Excepiton  $exception) : array

Handle the exception of a SubAgent.

Parameters

$subAgent
$request
\nre\core\Excepiton $exception

Occurred exception

Returns

array —

InlineError-SubAgent

newInlineError()

newInlineError(string  $label, \nre\core\Exception  $exception) 

Create a new InlineError.

Parameters

string $label

Name of the original Agent

\nre\core\Exception $exception

Occurred exception

newInlineErrorService()

newInlineErrorService() 

Handle a hardcore error that could not be handled by the system.

loadClass()

loadClass(string  $questtypeName, string  $fullClassName) 

Load the class of a QuesttypeAgent.

Parameters

string $questtypeName

Name of the QuesttypeAgent to load

string $fullClassName

Name of the class to load

Throws

\hhu\z\agents\ClassNotFoundException