mirror of
https://github.com/standardebooks/web.git
synced 2025-07-07 07:10:29 -04:00
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()`
12 lines
274 B
PHP
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;
|
|
}
|
|
}
|