Layer: Core · Source: lib/core/Theme/AbstractThemeViewModel.php:19 (lines 19–69)
abstract class AbstractThemeViewModel implements ThemeViewModelInterface
Base implementation shared by all theme view models.
Provides a single `fromRow()` contract and the escaped-value storage. All values are escaped once, at construction time, through a callable passed in by the factory. Subclasses only declare their public getters.
| Tag | Value |
|---|---|
@category | Theme |
@author | M.Noermoehammad |
@license | MIT |
@version | 1.0 |
| Relation | Type | Meaning |
|---|---|---|
| implements | ''ThemeViewModelInterface'' | contract |
None.
| Visibility | Type | Name | Default | Line |
|---|---|---|---|---|
protected | (untyped) | $values | [] | 22 |
| Visibility | Method | Summary | Line |
|---|---|---|---|
| public static | fromRow() | Build the view model from a prepared row, escaping each value once. | 31 |
| public | get() | Return the escaped value for a given key. | 42 |
| public | toArray() | Return all escaped display values keyed by their public name. | 50 |
| protected static | safe() | Escape a single raw value through the provided boundary. | 62 |
public static function fromRow(array $row, callable $escape)
line 31
Build the view model from a prepared row, escaping each value once.
| Parameter | Type | Default | Description |
|---|---|---|---|
$row | array | required | none |
$escape | callable | required | none |
Returns: (none declared) — static
public function get(string $key): ?string
lines 42–45 (4)
Return the escaped value for a given key.
| Parameter | Type | Default | Description |
|---|---|---|---|
$key | string | required | none |
Returns: ?string — string|null
public function toArray(): array
lines 50–53 (4)
Documentation inherited from ''Scriptlog\Core\Theme\ThemeViewModelInterface''.
Return all escaped display values keyed by their public name.
Takes no parameters.
Returns: array — array<string, string|null>
protected static function safe($raw, callable $escape): ?string
lines 62–68 (7)
Escape a single raw value through the provided boundary.
| Parameter | Type | Default | Description |
|---|---|---|---|
$raw | (untyped) | required | none |
$escape | callable | required | none |
Returns: ?string — string|null
This page is generated from source by 'tools/gendoc'. Edits will be overwritten.