You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

48 lines
1.5KB

  1. <?php
  2. namespace App\Entity;
  3. use App\Entity\User\User;
  4. use App\Repository\AbstractDataRepository;
  5. use Doctrine\Common\Collections\ArrayCollection;
  6. use Doctrine\Common\Collections\Collection;
  7. use Doctrine\ORM\Mapping as ORM;
  8. use Lc\SovBundle\Doctrine\EntityInterface;
  9. use Lc\SovBundle\Doctrine\Extension\StatusInterface;
  10. use Lc\SovBundle\Doctrine\Extension\StatusTrait;
  11. /**
  12. * @ORM\MappedSuperclass()
  13. */
  14. abstract class AbstractData implements StatusInterface, EntityInterface
  15. {
  16. use StatusTrait;
  17. const TERRITORY = "Territory";
  18. const CATEGORY_REVOLT = "Revolt";
  19. const CATEGORY_DREAM = "Dream";
  20. const CATEGORY_PROJECTBOOST = "ProjectBoost";
  21. const CATEGORY_PROJECTINSPIRING = "ProjectInspiring";
  22. const CATEGORY_LABEL_REVOLT = "Nos révoltes";
  23. const CATEGORY_LABEL_DREAM = "Nos rêves";
  24. const CATEGORY_LABEL_PROJECTBOOST = "Les actions à booster";
  25. const CATEGORY_LABEL_PROJECTINSPIRING = "Les actions inspirantes";
  26. static function getCategory(): array
  27. {
  28. return [
  29. self::CATEGORY_LABEL_REVOLT => self::CATEGORY_REVOLT,
  30. self::CATEGORY_LABEL_DREAM => self::CATEGORY_DREAM,
  31. self::CATEGORY_LABEL_PROJECTBOOST => self::CATEGORY_PROJECTBOOST,
  32. self::CATEGORY_LABEL_PROJECTINSPIRING => self::CATEGORY_PROJECTINSPIRING,
  33. ];
  34. }
  35. static function getCategoryByLabel(string $label): string
  36. {
  37. $categoryArray = self::getCategory();
  38. return $categoryArray[$label];
  39. }
  40. }