mirror of
https://github.com/standardebooks/web.git
synced 2025-07-06 14:50:39 -04:00
18 lines
417 B
PHP
18 lines
417 B
PHP
<?
|
|
use function Safe\preg_replace;
|
|
|
|
class Collection{
|
|
public string $Name;
|
|
public string $Url;
|
|
public ?int $SequenceNumber = null;
|
|
public ?string $Type = null;
|
|
|
|
public function __construct(string $name){
|
|
$this->Name = $name;
|
|
$this->Url = '/collections/' . Formatter::MakeUrlSafe($this->Name);
|
|
}
|
|
|
|
public function GetSortedName(): string{
|
|
return preg_replace('/^(the|and|a|)\s/ius', '', $this->Name);
|
|
}
|
|
}
|