WebflowItem.php 1.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657
  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"},
  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. protected $archived;
  22. protected $draft;
  23. public function __construct(WebflowApiCollectionItem $webflowApiCollectionItem) {
  24. $this->setFromData($webflowApiCollectionItem->data);
  25. }
  26. public function getId(): ?string {
  27. return $this->id;
  28. }
  29. public function getCid(): ?string {
  30. return $this->cid;
  31. }
  32. public function setCid(string $cid): self {
  33. $this->cid = $cid;
  34. return $this;
  35. }
  36. public function getArchived(): bool {
  37. return $this->archived;
  38. }
  39. public function getDraft(): bool {
  40. return $this->draft;
  41. }
  42. }