WebflowCollectionCategory.php 1.4 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273
  1. <?php
  2. namespace App\Entity;
  3. use ApiPlatform\Core\Annotation\ApiProperty;
  4. use ApiPlatform\Core\Annotation\ApiResource;
  5. use App\Serializer\ItemSerializedName;
  6. use Symfony\Component\Serializer\Annotation\Groups;
  7. /**
  8. * @ApiResource(
  9. * itemOperations={"get"},
  10. * collectionOperations={"get"}
  11. * )
  12. */
  13. class WebflowCollectionCategory extends AbstractWebflowCollectionItem {
  14. /**
  15. * @ApiProperty(identifier=true)
  16. * @Groups({
  17. * "event:collection:read",
  18. * "event:collection:write",
  19. * })
  20. * @ItemSerializedName("_id")
  21. */
  22. protected $id;
  23. /*
  24. * @Groups({
  25. * "event:collection:read",
  26. * "event:collection:write",
  27. * })
  28. */
  29. protected static $cid = '5ed0f77a42f75848a95ebf03';
  30. /*
  31. * @Groups({
  32. * "event:collection:read",
  33. * "event:collection:write",
  34. * })
  35. */
  36. private $name;
  37. /*
  38. * @Groups({
  39. * "event:collection:read",
  40. * "event:collection:write",
  41. * })
  42. */
  43. private $slug;
  44. public static function cid(): string {
  45. return self::$cid;
  46. }
  47. public function getName(): ?string {
  48. return $this->name;
  49. }
  50. public function setName(string $name): self {
  51. $this->name = $name;
  52. return $this;
  53. }
  54. public function getSlug(): ?string {
  55. return $this->slug;
  56. }
  57. protected function setSlug(string $slug): self {
  58. $this->slug = $slug;
  59. return $this;
  60. }
  61. }