# ConsultationRepository

Implements \NPS\Repository\IObjectRepository

Consultation repository class

author | Lukas Korinek
package | Default

### Methods

## __construct

    __construct(\Doctrine\ORM\EntityManagerInterface $em, \NPS\Factory\ConsultationFactory $factory)

### Arguments

#### $em

`\Doctrine\ORM\EntityManagerInterface`

#### $factory

`\NPS\Factory\ConsultationFactory`

## Gets a consultation by id

    getById(integer $id) : \NPS\Model\Consultation|null

### Arguments

#### $id

`integer`

### Response

`\NPS\Model\Consultation|null`

## Gets consultation history by a user

    getConsultationHistory(\NPS\Model\User $user, integer $offset, integer $limit, array|null $knowledgeBaseIds = NULL, boolean $flaggedOnly = false) : array

### Arguments

#### $user

`\NPS\Model\User`

#### $offset

`integer`

Result offset

#### $limit

`integer`

Result limit

#### $knowledgeBaseIds

`array|null`

To filter history by knowledge base ids

#### $flaggedOnly

`boolean`

To filter only flagged consultations

### Response

`array`

### Properties

## entityRepository

    entityRepository : \Doctrine\ORM\EntityRepository

var |

### Type(s)

`\Doctrine\ORM\EntityRepository`

## factory

    factory : \NPS\Factory\IObjectFactory

var |

### Type(s)

`\NPS\Factory\IObjectFactory`