objects

PageFile

A File that is publicly visible and knows which page it belongs to.

The only way a file gains public visibility.

$pageFile Phlat\Files\PageFile extends File 6 methods
Properties (14)
$pageFile->pageUuid string readonly
$pageFile->filename string readonly
$pageFile->fields array readonly Custom metadata values, keyed by field name - declared under files/{type}/_index.json's own "fields" key ($this->type: image, video, audio, document, ...), resolved lazily via field()/fieldSet().
$pageFile->uri string readonly
$pageFile->name ?string readonly
$pageFile->directory ?string readonly
$pageFile->basename ?string readonly
$pageFile->extension ?string readonly
$pageFile->modified ?int readonly
$pageFile->size ?int readonly
$pageFile->contents ?string
$pageFile->mime ?string
$pageFile->type ?string
$pageFile->path string readonly
Show
  • field A custom metadata field declared in files/{type}/_index.json's own "fields" list, resolved against this file's stored value.
  • fieldSet All declared custom metadata fields as resolved FieldValue instances.
  • isPublic True when a template has exposed this file, or any variant of it - see PageFiles::setVariant().
  • url The public URL, with a cache-busting suffix unless $cache_bust is false; null for a file with no owner.

Methods

$pageFile->field(string $key): FieldValue

A custom metadata field declared in files/{type}/_index.json's own "fields" list, resolved against this file's stored value.

Parameters (1)
$key string

Returns FieldValue

phlat/src/Files/PageFile.php:32
$pageFile->fieldSet(): FieldValueSet

All declared custom metadata fields as resolved FieldValue instances.

Returns FieldValueSet

phlat/src/Files/PageFile.php:38
$pageFile->isPublic(): bool

True when a template has exposed this file, or any variant of it - see PageFiles::setVariant().

Returns bool

phlat/src/Files/PageFile.php:60

url

$pageFile->url(bool $cache_bust = true): ?string

The public URL, with a cache-busting suffix unless $cache_bust is false; null for a file with no owner.

Parameters (1)
$cache_bust bool = true

Returns ?string

phlat/src/Files/PageFile.php:44

From File

dir

$pageFile->dir(): string

Returns string

phlat/src/Files/File.php:66
$pageFile->exists(): bool

Returns bool

phlat/src/Files/File.php:71