From f4396459a0126bf1efea612453ed104772c66afa Mon Sep 17 00:00:00 2001 From: Mathieu Jaumotte Date: Mon, 13 Dec 2021 16:42:41 +0100 Subject: [PATCH] comments: add isPinned() method --- .../ChillPersonBundle/Entity/AccompanyingPeriod/Comment.php | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/Bundle/ChillPersonBundle/Entity/AccompanyingPeriod/Comment.php b/src/Bundle/ChillPersonBundle/Entity/AccompanyingPeriod/Comment.php index 75d1b2857..7be0eccd1 100644 --- a/src/Bundle/ChillPersonBundle/Entity/AccompanyingPeriod/Comment.php +++ b/src/Bundle/ChillPersonBundle/Entity/AccompanyingPeriod/Comment.php @@ -158,4 +158,9 @@ class Comment implements TrackCreationInterface, TrackUpdateInterface return $this; } + + public function isPinned(): bool + { + return $this->getAccompanyingPeriod()->getPinnedComment() === $this; + } }