Skip to content

Commit

Permalink
Fill feed's update date with item's if empty
Browse files Browse the repository at this point in the history
  • Loading branch information
alexdebril committed Apr 7, 2021
1 parent 01144de commit 8c00496
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions src/FeedIo/Feed.php
Original file line number Diff line number Diff line change
Expand Up @@ -132,6 +132,10 @@ public function rewind(): void

public function add(ItemInterface $item) : FeedInterface
{
if ($item->getLastModified() > $this->getLastModified()) {
$this->setLastModified($item->getLastModified());
}

$this->items->append($item);

return $this;
Expand Down

0 comments on commit 8c00496

Please sign in to comment.