CoolCMS API

File extends File
in package

Attributes
#[Entity]
#[Table]
$name: 'cms_system_files'
#[TableAlias]
'file'

Table of Contents

Properties

$fileExtension  : string|null
$fileName  : string
$id  : int|null
$insertDatetime  : DateTime
$path  : string

Methods

__construct()  : mixed
callInitMethods()  : void
Calls `init{TraitName}()` for every used trait that defines such a method.
getAllTraits()  : array<string, string>
Returns all traits the class uses, including those used by parent classes and nested traits.
getFileExtension()  : string|null
getFileName()  : string
getFullFileName()  : string
getFullPath()  : string
getId()  : int|null
getInsertDatetime()  : DateTime
getPath()  : string
isPersisted()  : bool
setFileExtension()  : $this
setFileName()  : $this
setId()  : $this
setInsertDatetime()  : $this
setPath()  : $this
getTraitsRecursive()  : array<string, string>
Walks the trait list recursively and collects nested traits too.

Properties

$fileExtension

protected string|null $fileExtension = null
Attributes
#[Column]
$name: 'file_extension'
$type: 'string'
$length: 50
$nullable: true

$fileName

protected string $fileName = ''
Attributes
#[Column]
$name: 'file_name'
$type: 'string'
$length: 255

$id

protected int|null $id = null
Attributes
#[Column]
$name: 'file_id'
$type: 'integer'
$options: ['unsigned' => true]
#[GeneratedValue]
#[Id]

$insertDatetime

protected DateTime $insertDatetime = new DateTime()
Attributes
#[Column]
$name: 'insert_datetime'
$type: 'datetime'
#[ExternalReadonly]

$path

protected string $path = ''
Attributes
#[Column]
$name: 'path'
$type: 'string'
$length: 255

Methods

__construct()

public __construct([int|null $id = null ][, string $path = '' ][, string $fileName = '' ][, string|null $fileExtension = null ][, DateTime $insertDatetime = new DateTime() ]) : mixed
Parameters
$id : int|null = null
$path : string = ''
$fileName : string = ''
$fileExtension : string|null = null
$insertDatetime : DateTime = new DateTime()

callInitMethods()

Calls `init{TraitName}()` for every used trait that defines such a method.

public callInitMethods() : void

getAllTraits()

Returns all traits the class uses, including those used by parent classes and nested traits.

public getAllTraits() : array<string, string>
Return values
array<string, string>

getFileExtension()

public getFileExtension() : string|null
Return values
string|null

getFileName()

public getFileName() : string
Return values
string

getFullFileName()

public getFullFileName() : string
Return values
string

getFullPath()

public getFullPath() : string
Return values
string

getInsertDatetime()

public getInsertDatetime() : DateTime
Return values
DateTime

getPath()

public getPath() : string
Return values
string

setFileExtension()

public setFileExtension(string|null $fileExtension) : $this
Parameters
$fileExtension : string|null
Return values
$this

setFileName()

public setFileName(string $fileName) : $this
Parameters
$fileName : string
Return values
$this

setId()

public setId(int|null $id) : $this
Parameters
$id : int|null
Return values
$this

setInsertDatetime()

public setInsertDatetime(DateTime $insertDatetime) : $this
Parameters
$insertDatetime : DateTime
Return values
$this

setPath()

public setPath(string $path) : $this
Parameters
$path : string
Return values
$this

getTraitsRecursive()

Walks the trait list recursively and collects nested traits too.

private static getTraitsRecursive(array<string, string> $traits) : array<string, string>
Parameters
$traits : array<string, string>
Return values
array<string, string>
On this page

Search results