src/Entity/Evolution.php line 14

Open in your IDE?
  1. <?php
  2. namespace App\Entity;
  3. use App\Repository\EvolutionRepository;
  4. use Doctrine\DBAL\Types\Types;
  5. use Doctrine\ORM\Mapping as ORM;
  6. #[
  7.     ORM\Entity(repositoryClassEvolutionRepository::class),
  8.     ORM\Table(name'evolution'),
  9.     ORM\HasLifecycleCallbacks,
  10. ]
  11. class Evolution
  12. {
  13.     #[ORM\Id]
  14.     #[ORM\GeneratedValue]
  15.     #[ORM\Column]
  16.     private ?int $id null;
  17.     #[ORM\Column(typeTypes::TEXT)]
  18.     private ?string $description null;
  19.     #[ORM\Column(typeTypes::TEXT)]
  20.     private ?string $url null;
  21.     #[ORM\Column(typeTypes::DATE_IMMUTABLE)]
  22.     private \DateTimeInterface $created_at;
  23.     #[ORM\Column(typeTypes::DATE_IMMUTABLE)]
  24.     private \DateTimeInterface $updated_at;
  25.     #[ORM\ManyToOne(inversedBy'evolutions')]
  26.     #[ORM\JoinTable(name'customer_information_id')]
  27.     private ?CustomerInformation $customer_information null;
  28.     public function __construct()
  29.     {
  30.         $this->created_at = (new \DateTime())->setTime(000);
  31.         $this->updated_at = (new \DateTime())->setTime(000);
  32.     }
  33.     public function getId(): ?int
  34.     {
  35.         return $this->id;
  36.     }
  37.     public function getDescription(): ?string
  38.     {
  39.         return $this->description;
  40.     }
  41.     public function setDescription(string $description): self
  42.     {
  43.         $this->description $description;
  44.         return $this;
  45.     }
  46.     public function getUrl(): ?string
  47.     {
  48.         return $this->url;
  49.     }
  50.     public function setUrl(string $url): self
  51.     {
  52.         $this->url $url;
  53.         return $this;
  54.     }
  55.     public function getCreated_at(): \DateTimeInterface
  56.     {
  57.         return $this->created_at;
  58.     }
  59.     public function getUpdated_at(): \DateTimeInterface
  60.     {
  61.         return $this->updated_at;
  62.     }
  63.     public function setUpdated_at(\DateTimeInterface $updated_at): self
  64.     {
  65.         $this->updated_at $updated_at;
  66.         return $this;
  67.     }
  68.     #[ORM\PreUpdate]
  69.     public function preUpdate(): void
  70.     {
  71.         $this->updated_at = new \DateTime();
  72.     }
  73.     public function getCustomerInformation(): ?CustomerInformation
  74.     {
  75.         return $this->customer_information;
  76.     }
  77.     public function setCustomerInformation(?CustomerInformation $customer_information): self
  78.     {
  79.         $this->customer_information $customer_information;
  80.         return $this;
  81.     }
  82. }