src/Entity/Service.php line 12

Open in your IDE?
  1. <?php
  2. namespace App\Entity;
  3. use ApiPlatform\Core\Annotation\ApiResource;
  4. use App\Repository\ServiceRepository;
  5. use Doctrine\DBAL\Types\Types;
  6. use Doctrine\ORM\Mapping as ORM;
  7. #[ORM\Entity(repositoryClassServiceRepository::class)]
  8. #[ApiResource]
  9. class Service
  10. {
  11.     #[ORM\Id]
  12.     #[ORM\GeneratedValue]
  13.     #[ORM\Column]
  14.     private ?int $id null;
  15.     #[ORM\Column(length255)]
  16.     private ?string $designation null;
  17.     #[ORM\Column(typeTypes::TEXTnullabletrue)]
  18.     private ?string $description null;
  19.     #[ORM\Column(length255nullabletrue)]
  20.     private ?string $cover_url null;
  21.     #[ORM\Column(nullabletrue)]
  22.     private ?float $price null;
  23.     #[ORM\Column]
  24.     private ?\DateTimeImmutable $created_at null;
  25.     #[ORM\ManyToOne(inversedBy'services')]
  26.     private ?User $user null;
  27.     public function __construct()
  28.     {
  29.         $this->created_at = new \DateTimeImmutable();
  30.     }
  31.     public function getId(): ?int
  32.     {
  33.         return $this->id;
  34.     }
  35.     public function getDesignation(): ?string
  36.     {
  37.         return $this->designation;
  38.     }
  39.     public function setDesignation(string $designation): static
  40.     {
  41.         $this->designation $designation;
  42.         return $this;
  43.     }
  44.     public function getDescription(): ?string
  45.     {
  46.         return $this->description;
  47.     }
  48.     public function setDescription(?string $description): static
  49.     {
  50.         $this->description $description;
  51.         return $this;
  52.     }
  53.     public function getCoverUrl(): ?string
  54.     {
  55.         return $this->cover_url;
  56.     }
  57.     public function setCoverUrl(?string $cover_url): static
  58.     {
  59.         $this->cover_url $cover_url;
  60.         return $this;
  61.     }
  62.     public function getPrice(): ?float
  63.     {
  64.         return $this->price;
  65.     }
  66.     public function setPrice(?float $price): static
  67.     {
  68.         $this->price $price;
  69.         return $this;
  70.     }
  71.     public function getCreatedAt(): ?\DateTimeImmutable
  72.     {
  73.         return $this->created_at;
  74.     }
  75.     public function setCreatedAt(\DateTimeImmutable $created_at): static
  76.     {
  77.         $this->created_at $created_at;
  78.         return $this;
  79.     }
  80.     public function getUser(): ?User
  81.     {
  82.         return $this->user;
  83.     }
  84.     public function setUser(?User $user): static
  85.     {
  86.         $this->user $user;
  87.         return $this;
  88.     }
  89. }