mirror of
https://github.com/standardebooks/web.git
synced 2025-07-07 15:20:32 -04:00
25 lines
486 B
PHP
25 lines
486 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]) == 0){
|
|
throw new Exceptions\MuseumNotFoundException();
|
|
}
|
|
|
|
return $result[0];
|
|
}
|
|
}
|