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

25 lines
483 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(sizeof($result) == 0){
throw new Exceptions\MuseumNotFoundException();
}
return $result[0];
}
}