WebflowCollectionAudience.php 1.5 KB

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