# TokenRepository

Implements \NPS\Repository\IObjectRepository

Reset token repository class

author | Lukas Korinek
package | Default

### Methods

## __construct

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

### Arguments

#### $em

`\Doctrine\ORM\EntityManagerInterface`

#### $factory

`\NPS\Factory\TokenFactory`

## Gets a reset token by its hash

    getByHash(string $type, string $hash) : \NPS\Model\AbstractToken|null

### Arguments

#### $type

`string`

Requested token type, refer to the class constrants

#### $hash

`string`

### Response

`\NPS\Model\AbstractToken|null`

## Gets an object by its id

    getById(integer $id) : mixed

inheritDoc |

### Arguments

#### $id

`integer`

### Response

`mixed`

### Constants

## TOKEN_PASSWORD_RESET

    TOKEN_PASSWORD_RESET

## TOKEN_USER_ACTIVATION

    TOKEN_USER_ACTIVATION

### Properties

## activationEntityRepository

    activationEntityRepository : \Doctrine\ORM\EntityRepository

var |

### Type(s)

`\Doctrine\ORM\EntityRepository`

## resetEntityRepository

    resetEntityRepository : \Doctrine\ORM\EntityRepository

var |

### Type(s)

`\Doctrine\ORM\EntityRepository`

## entityRepository

    entityRepository : \Doctrine\ORM\EntityRepository

var |

### Type(s)

`\Doctrine\ORM\EntityRepository`

## factory

    factory : \NPS\Factory\TokenFactory

var |

### Type(s)

`\NPS\Factory\TokenFactory`