From a50c117a985289a4fb6c3756493b7d9645ac928a Mon Sep 17 00:00:00 2001 From: Jason Williams Date: Wed, 28 Oct 2020 16:54:22 -0600 Subject: [PATCH] Update channels model to set default icon in the event that one doesn't exist, as described in #55 --- .../jasonwilliams/feed/models/Channels.php | 72 ++++++++++--------- 1 file changed, 39 insertions(+), 33 deletions(-) diff --git a/www/plugins/jasonwilliams/feed/models/Channels.php b/www/plugins/jasonwilliams/feed/models/Channels.php index 5d677c9..6820958 100644 --- a/www/plugins/jasonwilliams/feed/models/Channels.php +++ b/www/plugins/jasonwilliams/feed/models/Channels.php @@ -1,33 +1,39 @@ - ['jasonwilliams\feed\Models\FeedItem', 'key' => 'channel_id'] - ]; -} + ['jasonwilliams\feed\Models\FeedItem', 'key' => 'channel_id'] + ]; + + public function afterFetch() + { + // Add a default icon if there isn't one already + if (!$this->icon) $this->icon = "fas fa-sticky-note"; + } +}