Site final readonly class
Minn\Content\Site · public/minn/src/Minn/Content/Site.php · 114 lines
Site-wide options and the site's clock.
Used by 66 (show)
Constants and properties
| private | readonly Minn\Db $db | Promoted from the constructor. |
Public
| new | __construct(Minn\Db $db)# | |
| method | option(string $name): ?string# | One option's raw value, or null when it is unset. |
| method | setOption(string $name, string $value, ?string $autoload = NULL): void# | Writes an option, inserting it as autoloaded when it does not exist; the option store hears of it. An $autoload given is written too, so a cache the engine reads on demand (autoload "off") stays out of the list every request loads. |
| method | deleteOption(string $name): void# | Removes an option row; the option store hears of it. |
| method | defaultDiscussion(string $type, string $kind): string# | A new post's comment or ping status, as the reference picks it: a post follows the site's two defaults, an attachment follows the comment default and never takes pings, a page and every other type start closed; with plugins loaded, get_default_comment_status() decides (support a plugin removed, the filter). $kind is "comment" or "pingback". |
| method | timezone(): DateTimeZone# | The site's timezone (wp_timezone): the zone timezone_string names, else gmt_offset as a fixed offset. With a zone set, the stored gmt_offset is not read at all, as the reference does not read it. |
| method | gmtOffset(): int# | The site's offset from UTC in seconds now: the zone's, daylight saving included, or gmt_offset's. |
| method | localNow(): string# | Now in the site's local time, MySQL format. |
| method | localDate(string $input): array# | A site-local datetime from a write body ("2031-01-01T00:00:00") to the pair of columns it fills, plus its timestamp. @return array{0: string, 1: string, 2: int} local, gmt, timestamp |
| method | gmtDate(string $input): array# | A GMT datetime from a write body (date_gmt) to the same pair of columns, its local half in the site's zone at that date. @return array{0: string, 1: string, 2: int} local, gmt, timestamp |
Nothing matches.