web/lib/EbookSource.php
Mike Colagrosso 2098b265a8 Rename the constructor Ebook::__construct() to static Ebook::FromFilesystem()
Also added `GetFoo()` methods for all the derived properties like `GetUrl()`, `GetHasDownloads()`, etc. Removed that logic from the constructor so that it's reusable in `Ebook::FromFilesystem()` and `Ebook::GetByIdentifier()`
2024-11-04 13:16:56 -06:00

12 lines
274 B
PHP

<?
class EbookSource{
public EbookSourceType $Type;
public string $Url;
public static function FromTypeAndUrl(EbookSourceType $type, string $url): EbookSource{
$instance = new EbookSource();
$instance->Type = $type;
$instance->Url = $url;
return $instance;
}
}