<?php
 class vB_Entity_WebManifest extends vB_Entity implements Stringable { use vB_Trait_NoSerialize; public function __construct( public string $name, public array $icons, public string $start_url, public string $display ) { $allowedDisplay = [ 'fullscreen', 'standalone', 'minimal-ui', 'browser', ]; if (!in_array($this->display, $allowedDisplay)) { $this->display = 'browser'; } } public function __toString(): string { $data = $this->jsonSerialize(); return json_encode($data, true); } public static function createFromArray(array $dbrecord) : static { return new vB_Entity_WebManifest( $dbrecord['name'], $dbrecord['icons'], $dbrecord['start_url'], $dbrecord['display'] ); } } 