# IExpertSystemBridge

Extends \NPS\Etc\IMessage

Default interface to plug-in any expert system

author | Lukas Korinek
package | Default

### Methods

## Rewinds the consultation back by one question

    back() : boolean

### Response

`boolean`

## Ends the current consultation

    endConsultation() : boolean

### Response

`boolean`

## Shifts the consultation to go forward by one question (answered)

    forward() : boolean

### Response

`boolean`

## Gets hypothesis for the consultation and their rank

    getHypothesis() : array|null

### Response

`array|null`

Array of hypothesis content elements, null on failure

## Gets the language which is currently set for the consultation

    getLanguage() : string

### Response

`string`

null on failure

## Gets next question

    getQuestion() : \NPS\Model\TraversableXMLElement|null

### Response

`\NPS\Model\TraversableXMLElement|null`

Element with question details, null on failure

## Gets all the supported languages of this base

    getSupportedLanguages() : array

### Response

`array`

## Determines if the consultation has ended

    isEnded() : boolean|null

### Response

`boolean|null`

Null on failure

## Loads a consultation from stored state

    loadConsultationState(array $data) : boolean

### Arguments

#### $data

`array`

### Response

`boolean`

True on success

## Returns history of all messages for this object

    logMessages() : array

inherited

### Response

`array`

of strings

## Gets a message and moves internal pointer

    popMessage() : string|null

inherited

### Response

`string|null`

## Saves the consultation and returns consultation data

    saveConsultationState() : array

### Response

`array`

with keys "base", "started", "language", "internal"

## Sets answer to the current question

    setAnswer(mixed $answer) : boolean

### Arguments

#### $answer

`mixed`

### Response

`boolean`

## Sets the language of the consultation

    setLanguage(string $language) : boolean|null

### Arguments

#### $language

`string`

One of the languages

### Response

`boolean|null`

Null for an unsupported language. False for command fail

## Starts a consultation

    startConsultation(string $path) : boolean

### Arguments

#### $path

`string`

Knowledge base path

### Response

`boolean`

True on success