# AbstractToken

Implements \NPS\Model\IDomainObject

Represents a token model object

author | Lukas Korinek
package | Default

### Methods

## __construct

    __construct(\NPS\Entity\AbstractTokenEntity $entity, integer $ttl)

### Arguments

#### $entity

`\NPS\Entity\AbstractTokenEntity`

#### $ttl

`integer`

Token time to live in seconds

## Gets the entity of the object

    getEntity() : \NPS\Entity\IEntity

inheritDoc |

### Response

`\NPS\Entity\IEntity`

## Gets the id of the object

    getId() : integer

inheritDoc |

### Response

`integer`

## Checks if the token has been used already

    isUsed() : boolean

### Response

`boolean`

## Checks if the token is valid

    isValid() : boolean

### Response

`boolean`

## Marks the reset token as used

    markAsUsed()

### Properties

## entity

    entity : \NPS\Entity\AbstractTokenEntity

var |

### Type(s)

`\NPS\Entity\AbstractTokenEntity`

## ttl

    ttl : integer

var |

### Type(s)

`integer`