src/Application/Front/Manager/PostTagManager.php line 17

  1. <?php
  2. declare(strict_types=1);
  3. namespace App\Application\Front\Manager;
  4. use App\Domain\BlogPost\Entity\PostTag;
  5. use App\Domain\BlogPost\Repository\PostTagRepository;
  6. class PostTagManager
  7. {
  8.     public function __construct(
  9.         private readonly PostTagRepository $postTagRepository
  10.     ) {
  11.     }
  12.     public function list(): array
  13.     {
  14.         return $this->postTagRepository->findAll();
  15.     }
  16.     public function getBySlug(string $slug): ?PostTag
  17.     {
  18.         return $this->postTagRepository->findOneBy(['slug' => $slug]);
  19.     }
  20. }