Beta version

class Document extends AbstractDateTimed

Documents entity represent a file on server with datetime and naming.

Properties

static array $mimeToIcon Associate mime type to simple types.

Methods

int
getId()

Get entity unique identifier.

setId(int $id)

No description

getCreatedAt()

No description

$this
setCreatedAt(DateTime $createdAt)

No description

getUpdatedAt()

No description

$this
setUpdatedAt(DateTime $updatedAt)

No description

preUpdate()

No description

prePersist()

No description

$this
resetDates()

Set creation and update date to now.

string
getFilename()

No description

$this
setFilename(string $filename)

No description

string
getMimeType()

No description

$this
setMimeType(string $mimeType)

No description

string
getShortType()

Get short type name for current document Mime type.

string
getShortMimeType()

Get short Mime type.

boolean
isImage()

Is current document an image.

boolean
isSvg()

Is current document a vector SVG file.

boolean
isVideo()

Is current document a video.

boolean
isAudio()

Is current document an audio file.

bool
isPdf()

Is current document a PDF file.

string
getFolder()

No description

$this
setFolder($folder)

Set folder name.

string
getRelativeUrl()

No description

string
getAbsolutePath()

Return absolute file path according to its privacy status.

string|null
getPublicAbsolutePath()

Only return public absolute file path.

string|null
getPrivateAbsolutePath()

Only return private absolute file path.

string
getEmbedId()

No description

$this
setEmbedId(string $embedId)

No description

string
getEmbedPlatform()

No description

$this
setEmbedPlatform(string $embedPlatform)

No description

boolean
isEmbed()

Tells if current document has embed media informations.

boolean
isPrivate()

No description

$this
setPrivate(boolean $private)

No description

getViewer()

No description

getHandler()

No description

ArrayCollection
getNodesSourcesByFields()

No description

ArrayCollection
getFolders()

No description

$this
addFolder(Folder $folder)

No description

ArrayCollection
getDocumentTranslations()

No description

Collection
getDocumentTranslationsByTranslation(Translation $translation)

No description

$this
addDocumentTranslation(DocumentTranslation $documentTranslation)

No description

bool
hasTranslations()

No description

__construct()

Create a new Document.

static string
getFilesFolder()

No description

static string
getFilesFolderName()

No description

static string
getPrivateFilesFolder()

No description

static string
getPrivateFilesFolderName()

No description

Document|null
getRawDocument()

Gets the value of rawDocument.

setRawDocument(Document $rawDocument = null)

Sets the value of rawDocument.

boolean
isRaw()

Is document a raw one.

setRaw(boolean $raw)

Sets the value of raw.

bool
fileExists()

No description

Document|null
getDownscaledDocument()

Gets the downscaledDocument.

string|null
getOrientation()

Get image orientation.

array|null
getImageSize()

No description

float|null
getImageSizeRatio()

No description

Details

in AbstractEntity at line 51
int getId()

Get entity unique identifier.

Return Value

int

in AbstractEntity at line 60
AbstractEntity setId(int $id)

Parameters

int $id

Return Value

AbstractEntity

in AbstractDateTimed at line 53
DateTime getCreatedAt()

Return Value

DateTime

in AbstractDateTimed at line 63
$this setCreatedAt(DateTime $createdAt)

Parameters

DateTime $createdAt

Return Value

$this

in AbstractDateTimed at line 78
DateTime getUpdatedAt()

Return Value

DateTime

in AbstractDateTimed at line 88
$this setUpdatedAt(DateTime $updatedAt)

Parameters

DateTime $updatedAt

Return Value

$this

in AbstractDateTimed at line 98
preUpdate()

in AbstractDateTimed at line 105
prePersist()

in AbstractDateTimed at line 115
$this resetDates()

Set creation and update date to now.

Return Value

$this

at line 144
string getFilename()

Return Value

string

at line 153
$this setFilename(string $filename)

Parameters

string $filename

Return Value

$this

at line 167
string getMimeType()

Return Value

string

at line 176
$this setMimeType(string $mimeType)

Parameters

string $mimeType

Return Value

$this

at line 204
string getShortType()

Get short type name for current document Mime type.

Return Value

string

at line 218
string getShortMimeType()

Get short Mime type.

Return Value

string

at line 229
boolean isImage()

Is current document an image.

Return Value

boolean

at line 239
boolean isSvg()

Is current document a vector SVG file.

Return Value

boolean

at line 249
boolean isVideo()

Is current document a video.

Return Value

boolean

at line 259
boolean isAudio()

Is current document an audio file.

Return Value

boolean

at line 269
bool isPdf()

Is current document a PDF file.

Return Value

bool

at line 282
string getFolder()

Return Value

string

at line 293
$this setFolder($folder)

Set folder name.

Parameters

$folder

Return Value

$this

at line 302
string getRelativeUrl()

Return Value

string

at line 318
string getAbsolutePath()

Return absolute file path according to its privacy status.

Return Value

string

at line 329
string|null getPublicAbsolutePath()

Only return public absolute file path.

Return Value

string|null

at line 344
string|null getPrivateAbsolutePath()

Only return private absolute file path.

Return Value

string|null

at line 361
string getEmbedId()

Return Value

string

at line 370
$this setEmbedId(string $embedId)

Parameters

string $embedId

Return Value

$this

at line 385
string getEmbedPlatform()

Return Value

string

at line 394
$this setEmbedPlatform(string $embedPlatform)

Parameters

string $embedPlatform

Return Value

$this

at line 406
boolean isEmbed()

Tells if current document has embed media informations.

Return Value

boolean

at line 419
boolean isPrivate()

Return Value

boolean

at line 428
$this setPrivate(boolean $private)

Parameters

boolean $private

Return Value

$this

at line 438
DocumentViewer getViewer()

Return Value

DocumentViewer

at line 446
DocumentHandler getHandler()

Return Value

DocumentHandler

at line 460
ArrayCollection getNodesSourcesByFields()

Return Value

ArrayCollection

at line 474
ArrayCollection getFolders()

Return Value

ArrayCollection

at line 483
$this addFolder(Folder $folder)

Parameters

Folder $folder

Return Value

$this

at line 501
ArrayCollection getDocumentTranslations()

Return Value

ArrayCollection

at line 510
Collection getDocumentTranslationsByTranslation(Translation $translation)

Parameters

Translation $translation

Return Value

Collection

at line 522
$this addDocumentTranslation(DocumentTranslation $documentTranslation)

Parameters

DocumentTranslation $documentTranslation

Return Value

$this

at line 534
bool hasTranslations()

Return Value

bool

at line 542
__construct()

Create a new Document.

at line 554
static string getFilesFolder()

Return Value

string Return absolute path to public files.

at line 563
static string getFilesFolderName()

Return Value

string

at line 572
static string getPrivateFilesFolder()

Return Value

string Return absolute path to private files. This path should be protected.

at line 581
static string getPrivateFilesFolderName()

Return Value

string

at line 591
Document|null getRawDocument()

Gets the value of rawDocument.

Return Value

Document|null

at line 603
Document setRawDocument(Document $rawDocument = null)

Sets the value of rawDocument.

Parameters

Document $rawDocument the raw document

Return Value

Document

at line 615
boolean isRaw()

Is document a raw one.

Return Value

boolean

at line 627
Document setRaw(boolean $raw)

Sets the value of raw.

Parameters

boolean $raw the raw

Return Value

Document

at line 638
bool fileExists()

Return Value

bool

at line 649
Document|null getDownscaledDocument()

Gets the downscaledDocument.

Return Value

Document|null

at line 664
string|null getOrientation()

Get image orientation.

  • Return null if document is not an Image
  • Return 'landscape' if width is higher or equal to height
  • Return 'portrait' if height is strictly lower to width

Return Value

string|null

at line 678
array|null getImageSize()

Return Value

array|null

at line 696
float|null getImageSizeRatio()

Return Value

float|null