Document
extends BaseEntity
in package
Document Entity
Generic polymorphic document storage entity. Follows the same pattern as Notes. Used for storing uploaded files with metadata and integrity verification.
Table of Contents
Properties
- $branch_id : int|null
- $checksum : string
- $created : DateTime
- $created_by : int
- $creator : Member
- $entity_id : int
- $entity_type : string
- $file_path : string
- $file_size : int
- $id : int
- $metadata : string|null
- $mime_type : string
- $modified : DateTime
- $modified_by : int|null
- $modifier : Member
- $original_filename : string
- $storage_adapter : string
- $stored_filename : string
- $uploaded_by : int
- $uploader : Member
- $_accessible : array<string, bool>
- Fields that can be mass assigned using newEntity() or patchEntity().
Methods
- getBranchId() : int|null
- Get the branch ID for authorization checks.
- _getFileSizeFormatted() : string
- Virtual field for human-readable file size
- _getMetadataArray() : array<string|int, mixed>|null
- Virtual field for metadata as array
Properties
$branch_id
public
int|null
$branch_id
Associated branch ID (when applicable)
$checksum
public
string
$checksum
$created
public
DateTime
$created
$created_by
public
int
$created_by
$creator
public
Member
$creator
$entity_id
public
int
$entity_id
$entity_type
public
string
$entity_type
$file_path
public
string
$file_path
$file_size
public
int
$file_size
$id
public
int
$id
$metadata
public
string|null
$metadata
$mime_type
public
string
$mime_type
$modified
public
DateTime
$modified
$modified_by
public
int|null
$modified_by
$modifier
public
Member
$modifier
$original_filename
public
string
$original_filename
$storage_adapter
public
string
$storage_adapter
$stored_filename
public
string
$stored_filename
$uploaded_by
public
int
$uploaded_by
$uploader
public
Member
$uploader
$_accessible
Fields that can be mass assigned using newEntity() or patchEntity().
protected
array<string, bool>
$_accessible
= ['entity_type' => true, 'entity_id' => true, 'original_filename' => true, 'stored_filename' => true, 'file_path' => true, 'mime_type' => true, 'file_size' => true, 'checksum' => true, 'storage_adapter' => true, 'metadata' => true, 'uploaded_by' => true, 'created' => true, 'modified' => true, 'created_by' => true, 'modified_by' => true, 'uploader' => true, 'creator' => true, 'modifier' => true]
Methods
getBranchId()
Get the branch ID for authorization checks.
public
getBranchId() : int|null
Child classes should override for complex branch relationships.
Return values
int|null —The branch ID, or null if no association
_getFileSizeFormatted()
Virtual field for human-readable file size
protected
_getFileSizeFormatted() : string
Return values
string_getMetadataArray()
Virtual field for metadata as array
protected
_getMetadataArray() : array<string|int, mixed>|null