src/CoreBundle/Entity/WordoptionIcon.php line 14

Open in your IDE?
  1. <?php
  2. namespace CoreBundle\Entity;
  3. use Doctrine\Common\Collections\ArrayCollection;
  4. use Doctrine\Common\Collections\Collection;
  5. use Doctrine\ORM\Mapping as ORM;
  6. use JsonSerializable;
  7. /**
  8. * @ORM\Table(name="wordoption_icons")
  9. * @ORM\Entity(repositoryClass="CoreBundle\Entity\WordoptionIconRepository")
  10. */
  11. class WordoptionIcon implements JsonSerializable
  12. {
  13. /**
  14. * @var int
  15. *
  16. * @ORM\Column(name="id", type="integer")
  17. * @ORM\Id
  18. * @ORM\GeneratedValue(strategy="AUTO")
  19. */
  20. private $id;
  21. /**
  22. * @var string
  23. *
  24. * @ORM\Column(name="abbreviation", type="string", length=255, unique=true)
  25. */
  26. private $abbreviation;
  27. /**
  28. * @var string
  29. *
  30. * @ORM\Column(name="icon", type="string", length=255, nullable=true)
  31. */
  32. private $icon;
  33. /**
  34. * @var string
  35. *
  36. * @ORM\Column(name="description", type="string", length=255, nullable=true)
  37. */
  38. private $description;
  39. /**
  40. * @var string
  41. *
  42. * @ORM\Column(name="display", type="string", length=255, options={"default" : "both"})
  43. */
  44. private $display;
  45. public function getId(): int
  46. {
  47. return $this->id;
  48. }
  49. /**
  50. * @param string $abbreviation
  51. * @return void
  52. */
  53. public function setAbbreviation(string $abbreviation)
  54. {
  55. $this->abbreviation = $abbreviation;
  56. }
  57. /**
  58. * @return string
  59. */
  60. public function getAbbreviation(): string
  61. {
  62. return $this->abbreviation;
  63. }
  64. /**
  65. * @return string
  66. */
  67. public function getIcon(): string
  68. {
  69. return $this->icon;
  70. }
  71. /**
  72. * @param string $icon
  73. * @return void
  74. */
  75. public function setIcon(string $icon): void
  76. {
  77. $this->icon = $icon;
  78. }
  79. /**
  80. * @return string
  81. */
  82. public function getDescription(): string
  83. {
  84. return $this->description;
  85. }
  86. /**
  87. * @param string $description
  88. * @return void
  89. */
  90. public function setDescription(string $description): void
  91. {
  92. $this->description = $description;
  93. }
  94. /**
  95. * @return string
  96. */
  97. public function getDisplay(): string
  98. {
  99. return $this->display;
  100. }
  101. /**
  102. * @param string $display
  103. * @return void
  104. */
  105. public function setDisplay(string $display): void
  106. {
  107. $this->display = $display;
  108. }
  109. public function jsonSerialize(): mixed
  110. {
  111. return [
  112. "id" => $this->id,
  113. "abbreviation" => $this->abbreviation,
  114. "icon" => "http://{$_SERVER['HTTP_HOST']}/bundles/abacuscore/wordoption_icons/{$this->icon}",
  115. "description" => $this->description,
  116. "display" => $this->display
  117. ];
  118. }
  119. }