# UserQueryFactory

Implements \NPS\Factory\IObjectFactory

User query factory

author | Lukas Korinek
package | Default

### Methods

## __construct

    __construct(\Doctrine\ORM\EntityManagerInterface $em, \NPS\Factory\UserFactory $userFactory, \NPS\Factory\FileFactory $fileFactory, \NPS\DependencyInjection\Mailer $mailer, string $emailAdmin)

### Arguments

#### $em

`\Doctrine\ORM\EntityManagerInterface`

#### $userFactory

`\NPS\Factory\UserFactory`

#### $fileFactory

`\NPS\Factory\FileFactory`

#### $mailer

`\NPS\DependencyInjection\Mailer`

#### $emailAdmin

`string`

Email of the application admin to which feedback mails should be sent

## Creates a user query

    create(integer $type, string $text, string $email = null, \NPS\Model\User $user = null, \NPS\Model\File $attachment = null, array $history = null) : \NPS\Model\AbstractUserQuery

### Arguments

#### $type

`integer`

Target user query type

#### $text

`string`

#### $email

`string`

#### $user

`\NPS\Model\User`

#### $attachment

`\NPS\Model\File`

#### $history

`array`

### Response

`\NPS\Model\AbstractUserQuery`

## Loads a factored object from the memory

    load(mixed $entity, \Closure $callback) : mixed

inherited

### Arguments

#### $entity

`mixed`

Entity for which to load the object

#### $callback

`\Closure`

### Response

`mixed`

## Creates an object out of its doctrine entity

    make(\NPS\Entity\IEntity $entity) : \NPS\Model\IDomainObject

inheritDoc |

### Arguments

#### $entity

`\NPS\Entity\IEntity`

Entity object

### Response

`\NPS\Model\IDomainObject`

### Constants

## USER_QUERY_ERROR_REPORTING

    USER_QUERY_ERROR_REPORTING

## USER_QUERY_QUESTION

    USER_QUERY_QUESTION

### Properties

## em

    em : \Doctrine\ORM\EntityManagerInterface

var |

### Type(s)

`\Doctrine\ORM\EntityManagerInterface`

## userFactory

    userFactory : \NPS\Factory\UserFactory

var |

### Type(s)

`\NPS\Factory\UserFactory`

## fileFactory

    fileFactory : \NPS\Factory\FileFactory

var |

### Type(s)

`\NPS\Factory\FileFactory`

## mailer

    mailer : \NPS\DependencyInjection\Mailer

var |

### Type(s)

`\NPS\DependencyInjection\Mailer`

## emailAdmin

    emailAdmin : string

var |

### Type(s)

`string`

## memory

    memory : array

inherited

var |

### Type(s)

`array`