# File

Implements \NPS\Model\IDomainObject

package | Default

### Methods

## __construct

    __construct(\NPS\Entity\FileEntity $entity, \NPS\Model\User $uploader = null, string $mediaBasePath)

### Arguments

#### $entity

`\NPS\Entity\FileEntity`

#### $uploader

`\NPS\Model\User`

#### $mediaBasePath

`string`

URL path to publicly available media files

## __toString

    __toString()

## Gets content checksum

    getChecksum() : integer

### Response

`integer`

## Gets the file content

    getContent() : string

### Response

`string`

## Gets the creation (upload) date

    getDateCreated() : \DateTime

### Response

`\DateTime`

## Gets the entity of the object

    getEntity() : \NPS\Entity\IEntity

inheritDoc |

### Response

`\NPS\Entity\IEntity`

## Gets original filename

    getFileName() : string

### Response

`string`

## Gets the id of the object

    getId() : integer

inheritDoc |

### Response

`integer`

## Gets the file note

    getNote() : string|null

### Response

`string|null`

## Gets the file path

    getPath() : string

### Response

`string`

## Gets the real file path

    getRealPath() : string

### Response

`string`

## Gets associated tags

    getTags() : array

### Response

`array`

## Gets the file type

    getType() : integer

### Response

`integer`

## Gets the file uploader

    getUploader() : \NPS\Model\User

### Response

`\NPS\Model\User`

## Gets final url to the file

    getUrl() : string|null

### Response

`string|null`

## Checks if the file has the requested tag

    hasTag(string $tag) : boolean

### Arguments

#### $tag

`string`

### Response

`boolean`

## Updates contents of the file

    updateContent(string $content) : boolean

### Arguments

#### $content

`string`

### Response

`boolean`

True on success

### Constants

## FILE_IMAGE

    FILE_IMAGE

## FILE_ZIP

    FILE_ZIP

## FILE_VIDEO

    FILE_VIDEO

## FILE_AUDIO

    FILE_AUDIO

### Properties

## entity

    entity : \NPS\Entity\FileEntity

var |

### Type(s)

`\NPS\Entity\FileEntity`

## User who uploaded the image

    uploader : \NPS\Model\User

var | User who uploaded the image

### Type(s)

`\NPS\Model\User`

## mediaBasePath

    mediaBasePath : string

var |

### Type(s)

`string`

## content

    content : string

var |

### Type(s)

`string`