# Consultation

Implements \NPS\Model\IDomainObject

Consultation process handling

author | Lukas Korinek
package | Default

### Methods

## __construct

    __construct(\NPS\Entity\ConsultationEntity $entity, \NPS\Model\KnowledgeBase $base, \NPS\DependencyInjection\IExpertSystemBridge $es, \NPS\DependencyInjection\IXMLContentParser $parser, \NPS\Model\User $user = null)

### Arguments

#### $entity

`\NPS\Entity\ConsultationEntity`

#### $base

`\NPS\Model\KnowledgeBase`

#### $es

`\NPS\DependencyInjection\IExpertSystemBridge`

#### $parser

`\NPS\DependencyInjection\IXMLContentParser`

#### $user

`\NPS\Model\User`

## Rewinds the consultation to the previous question

    back() : void

## Ends this consultation

    end()

## Moves the consultation forward by one question

    forward() : boolean

### Response

`boolean`

## Gets answered questions and the answers

    getAnswers() : array

### Response

`array`

## Gets the end date of the consultation

    getDateEnded() : \DateTime

### Response

`\DateTime`

## Gets the start date of the consultation

    getDateStarted() : \DateTime

### Response

`\DateTime`

## Gets the entity of the object

    getEntity() : \NPS\Entity\IEntity

inheritDoc |

### Response

`\NPS\Entity\IEntity`

## Gets hypothesis of the consultation

    getHypothesis() : array

### Response

`array`

## Gets the id of the object

    getId() : integer

inheritDoc |

### Response

`integer`

## Gets the knowledge base of the consultation

    getKnowledgeBase() : \NPS\Model\KnowledgeBase

### Response

`\NPS\Model\KnowledgeBase`

## Gets actual question of the consultation

    getQuestion() : array

### Response

`array`

## Gets the stored consultation state as array

    getState() : array

### Response

`array`

## Gets the user conducting the consultation

    getUser() : \NPS\Model\User

### Response

`\NPS\Model\User`

## Has the consultation ended already ?

    isEnded() : boolean

### Response

`boolean`

## Is the consultation flagged?

    isFlagged() : boolean

### Response

`boolean`

## Parses a question from XML element to an array

    parseQuestion(\NPS\Model\TraversableXMLElement $question) : array

### Arguments

#### $question

`\NPS\Model\TraversableXMLElement`

### Response

`array`

## Sets an answer to the consultation

    setAnswer(mixed $answerId) : void

### Arguments

#### $answerId

`mixed`

## Sets the consultation state

    setState(array $state)

### Arguments

#### $state

`array`

## Toggles a flag on this consultation

    toggleFlag()

### Properties

## entity

    entity : \NPS\Entity\ConsultationEntity

var |

### Type(s)

`\NPS\Entity\ConsultationEntity`

## es

    es : \NPS\DependencyInjection\IExpertSystemBridge

var |

### Type(s)

`\NPS\DependencyInjection\IExpertSystemBridge`

## parser

    parser : \NPS\DependencyInjection\IXMLContentParser

var |

### Type(s)

`\NPS\DependencyInjection\IXMLContentParser`

## Knowledge base of the consultation

    base : \NPS\Model\KnowledgeBase

var | Knowledge base of the consultation

### Type(s)

`\NPS\Model\KnowledgeBase`

## User conducting the consultation

    user : \NPS\Model\User

var | User conducting the consultation

### Type(s)

`\NPS\Model\User`