# \nre\coreApi

Abstract class to implement an API.

The API is the center of each application and specifies how and what to run and render.

## Summary

Methods
Properties
Constants
__construct()
run()
render()
No public properties found
No constants found
log()
$request
$response
$log
N/A
loadToplevelAgent()
$toplevelAgent
N/A
abstract

File
  core/Api.inc
Package
  Default
Class hierarchy
  \nre\core\Api

## Tags

author | coderkun olli@coderkun.de

## Properties

### $request

    $request : \nre\core\Request

Die aktuelle Anfrage

#### Type

\nre\core\Request

#

## Tags

None found

### $response

    $response : \nre\core\Response

Die aktuelle Antwort

#### Type

\nre\core\Response

#

## Tags

None found

### $log

    $log : \nre\core\Logger

Log-System

#### Type

\nre\core\Logger

#

## Tags

None found

### $toplevelAgent

    $toplevelAgent : \nre\agents\ToplevelAgent

Der Toplevelagent

#### Type

\nre\agents\ToplevelAgent

#

## Tags

None found

## Methods

### __construct()

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

Construct a new API.

#### Parameters

\nre\core\Request | $request | Current request
\nre\core\Response | $response |

#

## Tags

None found

### run()

    run() : \Exception

Run the application.

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

#### Returns

\Exception —

Last occurred exception of an subagent

#

## Tags

None found

### render()

    render()

Render the output.

#

## Tags

None found

### log()

    log(\Exception  $exception, integer  $logMode)

Log an exception

#### Parameters

\Exception | $exception | Occurred exception
integer | $logMode | Log-mode

#

## Tags

None found

### loadToplevelAgent()

    loadToplevelAgent()

Load the ToplevelAgent specified by the request.

#### Throws

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

#

## Tags

None found

### Api.inc