Repository navigation
Internals Vfs Storage StorageEntry
Framework Internals · Subsystem overview · Developer guide
Source: awt_src/classes/vfs/storage/StorageEntry.php · Snapshot 8411f4287706.
VFS includes package resource lookup, database-backed file metadata, filesystem collaborators, transient pools and persistent PHP-array caches.
use model\exceptions\ModelCreationException;
use model\Model;
use vfs\storage\enums\EOwnerType;class StorageEntry extends ModelSource description (behavioral corrections are recorded in Known discrepancies):
Class StorageEntry
A pure data-model/entity (SRP). All file system concerns have been removed and now live in LocalFileSystemService. This class is only responsible for holding and validating storage entry state.
Declarations below preserve visibility, type, default and modifiers exactly. A typed property without an initializer remains uninitialized until its constructor or another method assigns it. Mutable fields belong to this instance unless marked static; readonly fields can be initialized once. Constructor-promoted properties are also listed below.
| Member | Declaration | Purpose or source contract |
|---|---|---|
| $id | public ?int $id; |
Used by __construct(), setUrl(), getId(). |
| $name | public ?string $name = null; |
Used by setName(), setUrl(), getName(). |
| $path | public ?string $path = null; |
Used by setPath(), getPath(). |
| $url | public ?string $url = null; |
Used by setUrl(), getUrl(). |
| $size | public ?int $size = null; |
Used by setSize(), getSize(). |
| $middleware | public ?string $middleware = null; |
Used by setMiddleware(), getMiddleware(). |
| $lastModified | public ?int $lastModified = 0; |
Used by setLastModified(), getLastModified(). |
| $ownerId | public ?int $ownerId = null; |
Used by setOwnerId(), getOwnerId(). |
| $ownerType | public string|EOwnerType $ownerType = EOwnerType::USER; |
Used by setOwnerType(), getOwnerType(). |
| Constructor-promoted | public function __construct(?int $id = null) |
Initialized from the constructor argument; default expression is evaluated when the argument is omitted. |
| Method | Signature |
|---|---|
| __construct | public function __construct(?int $id = null) |
| setPath | public function setPath(string $path): self |
| setSize | public function setSize(int $size): self |
| setLastModified | public function setLastModified(int $lastModified): self |
| setName | public function setName(string $name): self |
| setUrl | public function setUrl(?string $url = null): self |
| setMiddleware | public function setMiddleware(?string $middleware = null): self |
| setOwnerId | public function setOwnerId(?int $ownerId = null): self |
| setOwnerType | public function setOwnerType(?EOwnerType $ownerType = null): self |
| getOwnerId | public function getOwnerId(): ?int |
| getOwnerType | public function getOwnerType(): ?EOwnerType |
| getMiddleware | public function getMiddleware(): ?string |
| getPath | public function getPath(): string |
| getUrl | public function getUrl(): string |
| getName | public function getName(): string |
| getSize | public function getSize(): int |
| getLastModified | public function getLastModified(): int |
| getId | public function getId(): ?int |
public function __construct(?int $id = null)| Parameter | Type, modifiers and default | Purpose |
|---|---|---|
$id |
?int $id = null |
Record or runtime identifier selected by this operation. |
@throws ModelCreationException
State writes: $this->id, $this->model_source.
Implementation, validation guards and interaction order
/**
* @throws ModelCreationException
*/
public function __construct(?int $id = null)
{
parent::__construct();
$this->id = $id;
$this->model_source = 'awt_storage';
if ($this->id !== null) {
$this->selectByID($this->id, 'awt_storage');
}
}public function setPath(string $path): self| Parameter | Type, modifiers and default | Purpose |
|---|---|---|
$path |
string $path |
Filesystem or route path as defined by the owning component; no universal path normalization is implied. |
State writes: $this->path.
Return expressions (including local callbacks): $this.
Implementation, validation guards and interaction order
// ----------------------------------------------------------------
// Fluent setters
// ----------------------------------------------------------------
public function setPath(string $path): self
{
$this->path = $path;
return $this;
}public function setSize(int $size): self| Parameter | Type, modifiers and default | Purpose |
|---|---|---|
$size |
int $size |
Pre-computed file size in bytes. |
@param int $size Pre-computed file size in bytes.
State writes: $this->size.
Return expressions (including local callbacks): $this.
Implementation, validation guards and interaction order
/**
* @param int $size Pre-computed file size in bytes.
*/
public function setSize(int $size): self
{
$this->size = $size;
return $this;
}public function setLastModified(int $lastModified): self| Parameter | Type, modifiers and default | Purpose |
|---|---|---|
$lastModified |
int $lastModified |
Unix timestamp of the last modification. |
@param int $lastModified Unix timestamp of the last modification.
State writes: $this->lastModified.
Return expressions (including local callbacks): $this.
Implementation, validation guards and interaction order
/**
* @param int $lastModified Unix timestamp of the last modification.
*/
public function setLastModified(int $lastModified): self
{
$this->lastModified = $lastModified;
return $this;
}public function setName(string $name): self| Parameter | Type, modifiers and default | Purpose |
|---|---|---|
$name |
string $name |
Named key/label selected by this API; its exact scope is shown by the implementation trace. |
State writes: $this->name.
Return expressions (including local callbacks): $this.
Implementation, validation guards and interaction order
public function setName(string $name): self
{
$this->name = $name;
return $this;
}public function setUrl(?string $url = null): self| Parameter | Type, modifiers and default | Purpose |
|---|---|---|
$url |
?string $url = null |
Operation input; the exact use, validation and propagation are shown in the implementation trace. |
Provide an explicit URL, or pass null to derive it from id + name.
State writes: $this->url.
Return expressions (including local callbacks): $this.
Implementation, validation guards and interaction order
/**
* Provide an explicit URL, or pass null to derive it from id + name.
*/
public function setUrl(?string $url = null): self
{
$this->url = $url ?? '/storage/' . $this->id . '/' . rawurlencode($this->name ?? '');
return $this;
}public function setMiddleware(?string $middleware = null): self| Parameter | Type, modifiers and default | Purpose |
|---|---|---|
$middleware |
?string $middleware = null |
Middleware object or class name according to the component; route and storage return handling differ. |
State writes: $this->middleware.
Return expressions (including local callbacks): $this.
Implementation, validation guards and interaction order
public function setMiddleware(?string $middleware = null): self
{
$this->middleware = $middleware;
return $this;
}public function setOwnerId(?int $ownerId = null): self| Parameter | Type, modifiers and default | Purpose |
|---|---|---|
$ownerId |
?int $ownerId = null |
Owning record ID or null. |
State writes: $this->ownerId.
Return expressions (including local callbacks): $this.
Implementation, validation guards and interaction order
public function setOwnerId(?int $ownerId = null): self
{
$this->ownerId = $ownerId;
return $this;
}public function setOwnerType(?EOwnerType $ownerType = null): self| Parameter | Type, modifiers and default | Purpose |
|---|---|---|
$ownerType |
?EOwnerType $ownerType = null |
Storage owner category; a matching registered strategy is required for registration. |
State writes: $this->ownerType.
Return expressions (including local callbacks): $this.
Implementation, validation guards and interaction order
public function setOwnerType(?EOwnerType $ownerType = null): self
{
$this->ownerType = $ownerType ?? EOwnerType::USER;
return $this;
}public function getOwnerId(): ?intReturn expressions (including local callbacks): $this->ownerId.
Implementation, validation guards and interaction order
// ----------------------------------------------------------------
// Getters
// ----------------------------------------------------------------
public function getOwnerId(): ?int
{
return $this->ownerId;
}public function getOwnerType(): ?EOwnerTypeReturn expressions (including local callbacks): $this->ownerType instanceof EOwnerType ? $this->ownerType : EOwnerType::from($this->ownerType).
Implementation, validation guards and interaction order
public function getOwnerType(): ?EOwnerType
{
return $this->ownerType instanceof EOwnerType ? $this->ownerType : EOwnerType::from($this->ownerType);
}public function getMiddleware(): ?stringReturn expressions (including local callbacks): $this->middleware.
Implementation, validation guards and interaction order
public function getMiddleware(): ?string
{
return $this->middleware;
}public function getPath(): stringReturn expressions (including local callbacks): $this->path.
Implementation, validation guards and interaction order
public function getPath(): string
{
return $this->path;
}public function getUrl(): stringReturn expressions (including local callbacks): $this->url.
Implementation, validation guards and interaction order
public function getUrl(): string
{
return $this->url;
}public function getName(): stringReturn expressions (including local callbacks): $this->name.
Implementation, validation guards and interaction order
public function getName(): string
{
return $this->name;
}public function getSize(): intReturn expressions (including local callbacks): $this->size.
Implementation, validation guards and interaction order
public function getSize(): int
{
return $this->size;
}public function getLastModified(): intReturn expressions (including local callbacks): $this->lastModified.
Implementation, validation guards and interaction order
public function getLastModified(): int
{
return $this->lastModified;
}public function getId(): ?intReturn expressions (including local callbacks): $this->id.
Implementation, validation guards and interaction order
public function getId(): ?int
{
return $this->id;
}AWT Framework Wiki · Home · Installation Guide · Developer Guide · Framework Internals
Philosophy · Architecture · Known discrepancies · Verification
Installation Guide
Developer Guide
- Learning sequence
- First package
- Package structure
- Lifecycle
- Runtimes
- Events and objects
- Routing and controllers
- Views and resources
- Database and models
- Storage and caching
- Configuration and CLI
- Responses and errors
- Extension points
Framework Internals
- Architecture
- Bootstrap
- Packages
- Runtime
- Events and context
- Objects
- HTTP routing and controllers
- Rendering
- Blade integration
- Database
- Models
- Storage and caching
- Settings
- CLI
- Identity and sessions
- Responses
- Errors
- Complete source inventory
Documentation notes