Você não pode selecionar mais de 25 tópicos Os tópicos devem começar com uma letra ou um número, podem incluir traços ('-') e podem ter até 35 caracteres.

44 linhas
1.3KB

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