src/Entity/Statistics.php line 28

Open in your IDE?
  1. <?php
  2. namespace App\Entity;
  3. use ApiPlatform\Metadata\ApiResource;
  4. use App\Repository\StatisticsRepository;
  5. use Doctrine\DBAL\Types\Types;
  6. use Doctrine\ORM\Mapping as ORM;
  7. use ApiPlatform\Metadata\Get;
  8. use ApiPlatform\Metadata\GetCollection;
  9. use ApiPlatform\Metadata\Delete;
  10. use ApiPlatform\Metadata\Put;
  11. use ApiPlatform\Metadata\Post;
  12. use App\Controller\StatisticsController;
  13. #[ORM\Entity(repositoryClassStatisticsRepository::class)]
  14. #[ApiResource(
  15.     operations: [
  16.         new Get(
  17.             name'MyGet'
  18.             uriTemplate'/statistics/get'
  19.             controllerStatisticsController::class,
  20.             readfalse
  21.         )
  22.     ],
  23. )]
  24. class Statistics
  25. {
  26.     #[ORM\Id]
  27.     #[ORM\GeneratedValue]
  28.     #[ORM\Column]
  29.     private ?int $id null;
  30.     #[ORM\Column(length255nullabletrue)]
  31.     private ?string $name null;
  32.     #[ORM\Column(typeTypes::DATE_MUTABLEnullabletrue)]
  33.     private ?\DateTimeInterface $dateStart null;
  34.     #[ORM\Column(typeTypes::DATE_MUTABLEnullabletrue)]
  35.     private ?\DateTimeInterface $dateEnd null;
  36.     
  37.     public function getId(): ?int
  38.     {
  39.         return $this->id;
  40.     }
  41.     public function getName(): ?string
  42.     {
  43.         return $this->name;
  44.     }
  45.     public function setName(?string $name): self
  46.     {
  47.         $this->name $name;
  48.         return $this;
  49.     }
  50.     public function getDateStart(): ?\DateTimeInterface
  51.     {
  52.         return $this->dateStart;
  53.     }
  54.     public function setDateStart(?\DateTimeInterface $dateStart): self
  55.     {
  56.         $this->dateStart $dateStart;
  57.         return $this;
  58.     }
  59.     public function getDateEnd(): ?\DateTimeInterface
  60.     {
  61.         return $this->dateEnd;
  62.     }
  63.     public function setDateEnd(?\DateTimeInterface $dateEnd): self
  64.     {
  65.         $this->dateEnd $dateEnd;
  66.         return $this;
  67.     }
  68. }