mirror of
https://github.com/standardebooks/web.git
synced 2025-07-13 18:11:52 -04:00
Update PropertiesBase to new patterns and improve static analysis checks
This commit is contained in:
parent
5f0b57f7e9
commit
6c8414f844
33 changed files with 335 additions and 148 deletions
|
@ -2,6 +2,9 @@
|
|||
use Safe\DateTime;
|
||||
use Ramsey\Uuid\Uuid;
|
||||
|
||||
/**
|
||||
* @property string $Url
|
||||
*/
|
||||
class NewsletterSubscriber extends PropertiesBase{
|
||||
public $NewsletterSubscriberId;
|
||||
public $Uuid;
|
||||
|
@ -14,6 +17,10 @@ class NewsletterSubscriber extends PropertiesBase{
|
|||
public $Created;
|
||||
protected $Url = null;
|
||||
|
||||
// *******
|
||||
// GETTERS
|
||||
// *******
|
||||
|
||||
protected function GetUrl(): string{
|
||||
if($this->Url === null){
|
||||
$this->Url = SITE_URL . '/newsletter/subscribers/' . $this->Uuid;
|
||||
|
@ -22,6 +29,11 @@ class NewsletterSubscriber extends PropertiesBase{
|
|||
return $this->Url;
|
||||
}
|
||||
|
||||
|
||||
// *******
|
||||
// METHODS
|
||||
// *******
|
||||
|
||||
public function Create(): void{
|
||||
$this->Validate();
|
||||
|
||||
|
@ -78,6 +90,11 @@ class NewsletterSubscriber extends PropertiesBase{
|
|||
}
|
||||
}
|
||||
|
||||
|
||||
// ***********
|
||||
// ORM METHODS
|
||||
// ***********
|
||||
|
||||
public static function Get(string $uuid): NewsletterSubscriber{
|
||||
$subscribers = Db::Query('SELECT * from NewsletterSubscribers where Uuid = ?;', [$uuid], 'NewsletterSubscriber');
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue