Constants

INLINEERROR_AGENT

INLINEERROR_AGENT

Name of BottomlevelAgent for showing inline errors

Properties

$subAgents

$subAgents : array

SubAgents

Type

array

Methods

getLayout()

getLayout(string  $agentName) : string

Get the layout if it was explicitly defined.

Parameters

string $agentName

Agent name

Returns

string —

Layout of the IntermediateAgent

load()

load(string  $agentName) 

Load the class of an Agent.

Parameters

string $agentName

Name of the Agent to load

Throws

\nre\exceptions\AgentNotFoundException
\nre\exceptions\AgentNotValidException

factory()

factory(string  $agentName, \nre\core\Request  $request, \nre\core\Response  $response, \nre\core\Logger  $log = null) 

Instantiate an Agent (Factory Pattern).

Parameters

string $agentName

Name of the Agent to instantiate

\nre\core\Request $request

Current request

\nre\core\Response $response
\nre\core\Logger $log

Log-system

Throws

\nre\exceptions\DatamodelException
\nre\exceptions\DriverNotValidException
\nre\exceptions\DriverNotFoundException
\nre\exceptions\ViewNotFoundException
\nre\exceptions\ModelNotValidException
\nre\exceptions\ModelNotFoundException
\nre\exceptions\ControllerNotValidException
\nre\exceptions\ControllerNotFoundException

run()

run(\nre\core\Request  $request, \nre\core\Response  $response) : \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\exceptions\ParamsNotValidException
\nre\exceptions\IdNotFoundException
\nre\exceptions\DatamodelException
\nre\exceptions\ActionNotFoundException

Returns

\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

index()

index(\nre\core\Request  $request, \nre\core\Response  $response) 

Action: index.

Parameters

\nre\core\Request $request

Current request

\nre\core\Response $response

Current response

user()

user(\nre\core\Request  $request, \nre\core\Response  $response) 

Action: user.

Parameters

\nre\core\Request $request

Current request

\nre\core\Response $response

Current response

__construct()

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

Construct a new Agent.

Parameters

\nre\core\Request $request

Current request

\nre\core\Response $response
\nre\core\Logger $log

Log-system

Throws

\nre\exceptions\DatamodelException
\nre\exceptions\DriverNotValidException
\nre\exceptions\DriverNotFoundException
\nre\exceptions\ViewNotFoundException
\nre\exceptions\ModelNotValidException
\nre\exceptions\ModelNotFoundException
\nre\exceptions\ControllerNotValidException
\nre\exceptions\ControllerNotFoundException

actionConstruct()

actionConstruct() 

Construct SubAgents (per Action).

loadController()

loadController() 

Load the Controller of this Agent.

Throws

\nre\exceptions\DatamodelException
\nre\exceptions\DriverNotValidException
\nre\exceptions\DriverNotFoundException
\nre\exceptions\ViewNotFoundException
\nre\exceptions\ModelNotValidException
\nre\exceptions\ModelNotFoundException
\nre\exceptions\ControllerNotValidException
\nre\exceptions\ControllerNotFoundException

log()

log(\Exception  $exception, integer  $logMode) 

Log an error.

Parameters

\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\exceptions\ServiceUnavailableException
\nre\exceptions\AgentNotFoundException
\nre\exceptions\AgentNotValidException

_addSubAgent()

_addSubAgent(string  $agentName) 

Load a SubAgent and add it.

Parameters

string $agentName

Name of the Agent to load

Throws

\nre\exceptions\ServiceUnavailableException
\nre\exceptions\DatamodelException
\nre\exceptions\AgentNotFoundException
\nre\exceptions\AgentNotValidException

getAgentType()

getAgentType() : string

Determine the type of an Agent.

Returns

string —

Agent type

getClassName()

getClassName(string  $agentName, string  $agentType) : string

Determine the classname for the given Agent name.

Parameters

string $agentName

Agent name to get classname of

string $agentType

Agent type of given Agent name

Returns

string —

Classname for the Agent name

newSubAgent()

newSubAgent(string  $agentName) : array

Create a new SubAgent.

Parameters

string $agentName

Agent name

Throws

\nre\exceptions\DatamodelException

Returns

array —

SubAgent

renderSubAgent()

renderSubAgent(array  $subAgent) : string

Render a SubAgent.

Parameters

array $subAgent

SubAgent to render

Returns

string —

Generated output

errorInline()

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

Handle the exception of a SubAgent.

Parameters

array $subAgent

Original (Sub-) Agent

\nre\core\Request $request

Current request

\nre\core\Excepiton $exception

Occurred exception

Returns

array —

InlineError-SubAgent

newInlineError()

newInlineError(string  $label, \Exception  $exception) 

Create a new InlineError.

Parameters

string $label

Name of the original Agent

\Exception $exception

Occurred exception

newInlineErrorService()

newInlineErrorService() 

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