mirror of
https://github.com/standardebooks/web.git
synced 2025-07-14 10:31:59 -04:00
Add PropertyFromHttp trait and update codebase to use new pattern
This commit is contained in:
parent
c35c47b793
commit
acb30b897c
47 changed files with 851 additions and 527 deletions
|
@ -19,18 +19,19 @@ class AtomFeed extends Feed{
|
|||
$this->Stylesheet = SITE_URL . '/feeds/atom/style';
|
||||
}
|
||||
|
||||
|
||||
// *******
|
||||
// METHODS
|
||||
// *******
|
||||
|
||||
protected function GetXmlString(): string{
|
||||
if($this->XmlString === null){
|
||||
if(!isset($this->_XmlString)){
|
||||
$feed = Template::AtomFeed(['id' => $this->Id, 'url' => $this->Url, 'title' => $this->Title, 'subtitle' => $this->Subtitle, 'updated' => $this->Updated, 'entries' => $this->Entries]);
|
||||
|
||||
$this->XmlString = $this->CleanXmlString($feed);
|
||||
$this->_XmlString = $this->CleanXmlString($feed);
|
||||
}
|
||||
|
||||
return $this->XmlString;
|
||||
return $this->_XmlString;
|
||||
}
|
||||
|
||||
public function SaveIfChanged(): bool{
|
||||
|
@ -58,7 +59,7 @@ class AtomFeed extends Feed{
|
|||
$obj->Id = SITE_URL . $entry->Url;
|
||||
}
|
||||
else{
|
||||
$obj->Updated = $entry->Updated !== null ? $entry->Updated->format(Enums\DateTimeFormat::Iso->value) : '';
|
||||
$obj->Updated = $entry->Updated->format(Enums\DateTimeFormat::Iso->value);
|
||||
$obj->Id = $entry->Id;
|
||||
}
|
||||
$currentEntries[] = $obj;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue