WebflowItem.php 1.2 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162
  1. <?php
  2. namespace App\Entity;
  3. use ApiPlatform\Core\Annotation\ApiFilter;
  4. use ApiPlatform\Core\Annotation\ApiProperty;
  5. use ApiPlatform\Core\Annotation\ApiResource;
  6. use App\Http\WebflowApi\WebflowApiCollectionItem;
  7. use App\Filter\SearchFilter;
  8. /**
  9. * @ApiResource(
  10. * collectionOperations={"get", "post"},
  11. * itemOperations={"get"}
  12. * )
  13. * @ApiFilter(SearchFilter::class, properties={"cid": "exact"})
  14. */
  15. class WebflowItem extends AbstractEntity {
  16. /**
  17. * @ApiProperty(identifier=true)
  18. */
  19. protected $id;
  20. private $cid;
  21. private $reCaptcha = null;
  22. protected $archived;
  23. protected $draft;
  24. public function __construct(WebflowApiCollectionItem $webflowApiCollectionItem) {
  25. $this->setFromData($webflowApiCollectionItem->data);
  26. }
  27. public function getId(): ?string {
  28. return $this->id;
  29. }
  30. public function getCid(): ?string {
  31. return $this->cid;
  32. }
  33. public function setCid(string $cid): self {
  34. $this->cid = $cid;
  35. return $this;
  36. }
  37. public function getArchived(): bool {
  38. return $this->archived;
  39. }
  40. public function getDraft(): bool {
  41. return $this->draft;
  42. }
  43. public function setReCaptcha(string $value) {
  44. $this->reCaptcha = $value;
  45. }
  46. }