123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657 |
- <?php
- namespace App\Entity;
- use ApiPlatform\Core\Annotation\ApiProperty;
- use ApiPlatform\Core\Annotation\ApiResource;
- use App\Http\WebflowApi\WebflowApiCollection;
- use DateTimeImmutable;
- /**
- * @ApiResource(
- * collectionOperations={"get"},
- * itemOperations={"get"}
- * )
- */
- class WebflowCollection extends AbstractEntity {
- /**
- * @ApiProperty(identifier=true)
- */
- protected $id;
- private $name;
- private $slug;
- private $singularName;
- protected $lastUpdated;
- protected $createdOn;
- public function __construct(WebflowApiCollection $webflowApiCollection) {
- $this->setFromData($webflowApiCollection->data);
- }
- public function getId(): ?string {
- return $this->id;
- }
- public function getSingularName(): ?string {
- return $this->singularName;
- }
- public function setSingularName(string $sn): self {
- $this->singularName = $sn;
- return $this;
- }
- public function getLastUpdated(): \DateTimeInterface {
- return new DateTimeImmutable($this->lastUpdated);
- }
- public function getCreatedOn(): \DateTimeInterface {
- return new DateTimeImmutable($this->lastUpdated);
- }
- }
|