Scriptlog Docs

Scriptlog Documentation

Code reference for the Scriptlog codebase

User Tools

Site Tools


scriptlog:lib:core:archiveviewmodel

This is an old revision of the document!


ArchiveViewModel

Layer: Core · Source: lib/core/Theme/ArchiveViewModel.php:18 (lines 18–99)


final class ArchiveViewModel extends AbstractThemeViewModel

Archive view model.

Carries the already-escaped display fields for a monthly archive entry (archive.php / archives.php).

Docblock Metadata

^ Tag ^ Value ^
| ''@category'' | Theme |
| ''@author'' | M.Noermoehammad |
| ''@license'' | MIT |
| ''@version'' | 1.0 |

Inheritance

^ Relation ^ Type ^ Meaning ^
| extends | [[scriptlog:lib:core:abstractthemeviewmodel|''AbstractThemeViewModel'']] | parent class/interface |

Constants (0)

None.

Properties (0)

None declared.

Methods (7)

^ Visibility ^ Method ^ Summary ^ Line ^
| public static | ''fromRow()'' | Build an archive view model from a prepared row. | 30 |
| public static | ''fromPrepared()'' | Build an archive view model from already-prepared, already-safe values. | 63 |
| public | ''url()'' | @psalm-suppress PossiblyUnusedMethod -- public getter consumed by public/themes | 75 |
| public | ''label()'' | @psalm-suppress PossiblyUnusedMethod -- public getter consumed by public/themes | 80 |
| public | ''year()'' | @psalm-suppress PossiblyUnusedMethod -- public getter consumed by public/themes | 85 |
| public | ''month()'' | @psalm-suppress PossiblyUnusedMethod -- public getter consumed by public/themes | 90 |
| public | ''count()'' | @psalm-suppress PossiblyUnusedMethod -- public getter consumed by public/themes | 95 |

fromRow()

public static function fromRow(array $row, callable $escape)

lines 30–49 (20)

Build an archive view model from a prepared row.

Expects `url`, `label` and `count` keys (already composed by the model layer) OR raw month/year fields that are combined here.

^ Parameter ^ Type ^ Default ^ Description ^
| ''$row'' | ''array'' | //required// | //none// |
| ''$escape'' | ''callable'' | //required// | //none// |

Returns: (none declared) — static

fromPrepared()

public static function fromPrepared(array $prepared)

lines 63–72 (10)

Build an archive view model from already-prepared, already-safe values.

Mirrors PostViewModel::fromPrepared(): values are escaped exactly once at the normalization boundary (prepare_archive()) and stored verbatim.

^ Parameter ^ Type ^ Default ^ Description ^
| ''$prepared'' | ''array'' | //required// | //none// |

Returns: (none declared) — static

url()

public function url(): string

lines 75–78 (4)

@psalm-suppress PossiblyUnusedMethod – public getter consumed by public/themes

Takes no parameters.

Returns: string

label()

public function label(): ?string

lines 80–83 (4)

@psalm-suppress PossiblyUnusedMethod – public getter consumed by public/themes

Takes no parameters.

Returns: ?string

year()

public function year(): ?string

lines 85–88 (4)

@psalm-suppress PossiblyUnusedMethod – public getter consumed by public/themes

Takes no parameters.

Returns: ?string

month()

public function month(): ?string

lines 90–93 (4)

@psalm-suppress PossiblyUnusedMethod – public getter consumed by public/themes

Takes no parameters.

Returns: ?string

count()

public function count(): ?string

lines 95–98 (4)

@psalm-suppress PossiblyUnusedMethod – public getter consumed by public/themes

Takes no parameters.

Returns: ?string


This page is generated from source by 'tools/gendoc'. Edits will be overwritten.

scriptlog/lib/core/archiveviewmodel.1790413762.txt.gz · Last modified: by admin