File
extends BaseEntity
in package
implements
IdentifiableInterface
uses
IdentifiableTrait
AbstractYes
Attributes
- #[MappedSuperclass]
- #[TableAlias]
- $alias: 'file'
Table of Contents
Interfaces
- IdentifiableInterface
- Entity with a simple integer primary key. Most entities have one (often via {@see \App\Core\Traits\Shared\Models\Entities\IdentifiableTrait}); texts and links with a composite key do not, which is why `getId()` is not on {@see \App\Core\Base\BaseEntity}. Code that needs the id of a generic entity asks for this interface (parameter type, template bound, `instanceof`).
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'
$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|nullgetFileName()
public
getFileName() : string
Return values
stringgetFullFileName()
public
getFullFileName() : string
Return values
stringgetFullPath()
public
getFullPath() : string
Return values
stringgetId()
public
getId() : int|null
Return values
int|nullgetInsertDatetime()
public
getInsertDatetime() : DateTime
Return values
DateTimegetPath()
public
getPath() : string
Return values
stringisPersisted()
public
isPersisted() : bool
Return values
boolsetFileExtension()
public
setFileExtension(string|null $fileExtension) : $this
Parameters
- $fileExtension : string|null
Return values
$thissetFileName()
public
setFileName(string $fileName) : $this
Parameters
- $fileName : string
Return values
$thissetId()
public
setId(int|null $id) : $this
Parameters
- $id : int|null
Return values
$thissetInsertDatetime()
public
setInsertDatetime(DateTime $insertDatetime) : $this
Parameters
- $insertDatetime : DateTime
Return values
$thissetPath()
public
setPath(string $path) : $this
Parameters
- $path : string
Return values
$thisgetTraitsRecursive()
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>