KMP PHP API Reference

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)

$modified_by

public int|null $modified_by

$original_filename

public string $original_filename

$storage_adapter

public string $storage_adapter

$stored_filename

public string $stored_filename

$_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
Return values
array<string|int, mixed>|null

        
On this page

Search results