From 3576d72a0a1f5fd5200d87467117b6a2b8ec1a13 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bj=C3=B6rn=20Fromme?= Date: Sat, 14 Oct 2023 16:55:32 +0200 Subject: [PATCH] Feat: Add shortcut methods to determine status of uploaded document --- src/Entity/Upload.php | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/src/Entity/Upload.php b/src/Entity/Upload.php index 85eadd9..c10032e 100644 --- a/src/Entity/Upload.php +++ b/src/Entity/Upload.php @@ -119,6 +119,16 @@ class Upload implements BlameableEntityInterface, TimestampableEntityInterface return $this; } + public function isConfirmed(): bool + { + return in_array($this->getStatus(), [static::STATUS_CHECKED, static::STATUS_PAID]); + } + + public function isRejected(): bool + { + return static::STATUS_REJECTED === $this->getStatus(); + } + public function getFilename(): ?string { return $this->filename;