web/lib/Museum.php
2024-01-08 16:08:57 -06:00

25 lines
482 B
PHP

<?
class Museum extends PropertiesBase{
public int $MuseumId;
public string $Name;
public string $Domain;
public static function GetByUrl(?string $url): Museum{
if($url === null){
throw new Exceptions\MuseumNotFoundException();
}
$result = Db::Query('
SELECT *
from Museums
where ? like concat("%", Domain, "%")
limit 1;
', [$url], 'Museum');
if($result[0] === null){
throw new Exceptions\MuseumNotFoundException();
}
return $result[0];
}
}