# FileRepository

Implements \NPS\Repository\IObjectRepository

package | Default

### Methods

## __construct

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

### Arguments

#### $em

`\Doctrine\ORM\EntityManagerInterface`

#### $factory

`\NPS\Factory\FileFactory`

## Gets an object by its id

    getById(integer $id) : mixed

inheritDoc |

### Arguments

#### $id

`integer`

### Response

`mixed`

## Gets a file by path

    getByPath( $path) : \NPS\Model\File|null

### Arguments

#### $path

``

### Response

`\NPS\Model\File|null`

## Gets files by tag

    getByTag(string $tag, integer $limit = 50, integer $offset) : array

### Arguments

#### $tag

`string`

#### $limit

`integer`

#### $offset

`integer`

### Response

`array`

## Gets a file by tag and its original filename with extension

    getByTagAndFilename(string $tag, string $filename) : \NPS\Model\File|null

### Arguments

#### $tag

`string`

Tag to look for

#### $filename

`string`

Original filename with extension, e.g. sound.wav

### Response

`\NPS\Model\File|null`

## Gets files by file type

    getByType(integer $type, integer $limit = 50, integer $offset) : array

### Arguments

#### $type

`integer`

#### $limit

`integer`

#### $offset

`integer`

### Response

`array`

## Gets a new image id available

    getNewId() : integer

### Response

`integer`

### Properties

## entityRepository

    entityRepository : \Doctrine\ORM\EntityRepository

var |

### Type(s)

`\Doctrine\ORM\EntityRepository`

## factory

    factory : \NPS\Factory\FileFactory

var |

### Type(s)

`\NPS\Factory\FileFactory`