From 0c80159d7e108eccc050e0f7cd4d7898b7c00db4 Mon Sep 17 00:00:00 2001 From: matthieu Date: Tue, 19 May 2026 23:16:17 +0200 Subject: [PATCH] feat(mail) : MailFolder entity + repository --- src/Entity/MailFolder.php | 115 ++++++++++++++++++++++++ src/Repository/MailFolderRepository.php | 34 +++++++ 2 files changed, 149 insertions(+) create mode 100644 src/Entity/MailFolder.php create mode 100644 src/Repository/MailFolderRepository.php diff --git a/src/Entity/MailFolder.php b/src/Entity/MailFolder.php new file mode 100644 index 0000000..0b2462d --- /dev/null +++ b/src/Entity/MailFolder.php @@ -0,0 +1,115 @@ +id; + } + + public function getPath(): string + { + return $this->path; + } + + public function setPath(string $path): static + { + $this->path = $path; + + return $this; + } + + public function getDisplayName(): string + { + return $this->displayName; + } + + public function setDisplayName(string $displayName): static + { + $this->displayName = $displayName; + + return $this; + } + + public function getParentPath(): ?string + { + return $this->parentPath; + } + + public function setParentPath(?string $parentPath): static + { + $this->parentPath = $parentPath; + + return $this; + } + + public function getUnreadCount(): int + { + return $this->unreadCount; + } + + public function setUnreadCount(int $unreadCount): static + { + $this->unreadCount = $unreadCount; + + return $this; + } + + public function getTotalCount(): int + { + return $this->totalCount; + } + + public function setTotalCount(int $totalCount): static + { + $this->totalCount = $totalCount; + + return $this; + } + + public function getLastSyncedAt(): ?DateTimeImmutable + { + return $this->lastSyncedAt; + } + + public function setLastSyncedAt(?DateTimeImmutable $lastSyncedAt): static + { + $this->lastSyncedAt = $lastSyncedAt; + + return $this; + } +} diff --git a/src/Repository/MailFolderRepository.php b/src/Repository/MailFolderRepository.php new file mode 100644 index 0000000..d228d35 --- /dev/null +++ b/src/Repository/MailFolderRepository.php @@ -0,0 +1,34 @@ + + */ + public function findAllOrderedByPath(): array + { + return $this->createQueryBuilder('f') + ->orderBy('f.path', 'ASC') + ->getQuery() + ->getResult() + ; + } + + public function findByPath(string $path): ?MailFolder + { + return $this->findOneBy(['path' => $path]); + } +}