src/Entity/Ordonnance.php line 18

Open in your IDE?
  1. <?php
  2. namespace App\Entity;
  3. use Doctrine\ORM\Mapping as ORM;
  4. use App\Entity\Intervention;
  5. use ApiPlatform\Core\Annotation\ApiResource;
  6. use App\Repository\OrdonnanceRepository;
  7. use App\Entity\Client;
  8. use DateTime;
  9. use Symfony\Component\Serializer\Annotation\Groups;
  10. /**
  11.  * @ApiResource
  12.  * @ORM\Table()
  13.  * @ORM\Entity(repositoryClass=OrdonnanceRepository::class)
  14.  */
  15. class Ordonnance
  16. {
  17.     /**
  18.      * @var integer $id
  19.      *
  20.      * @ORM\Id
  21.      * @ORM\Column(type="integer")
  22.      * @ORM\GeneratedValue(strategy="AUTO")
  23.      *
  24.      * @Groups({"read"})
  25.      */
  26.     private $id;
  27.     /**
  28.      * @var string
  29.      *
  30.      * @ORM\Column(name="description", type="text",  nullable=true)
  31.      *
  32.      */
  33.     private $description;
  34.     /**
  35.      * @var string
  36.      *
  37.      * @ORM\Column(name="prescription", type="json",  nullable=true)
  38.      *
  39.      */
  40.     private $prescription;
  41.     /**
  42.      * @var Intervention
  43.      * @ORM\ManyToOne(
  44.      *   targetEntity=Intervention::class, inversedBy="ordonnances"
  45.      * )
  46.      * @Groups({"read"})
  47.      */
  48.     private $intervention;
  49.     /**
  50.      * @var Intervention
  51.      * @ORM\ManyToOne(
  52.      *   targetEntity=Client::class
  53.      * )
  54.      * @Groups({"read"})
  55.      */
  56.     private $client;
  57.     /**
  58.      * @var DateTime
  59.      *
  60.      * @ORM\Column(name="createdAt", type="datetime", options={"default": "CURRENT_TIMESTAMP"})
  61.      */
  62.     private $createdAt;
  63.     /**
  64.      * @var DateTime
  65.      *
  66.      * @ORM\Column(name="updatedAt", type="datetime", options={"default": "CURRENT_TIMESTAMP"}, nullable=true)
  67.      */
  68.     private $updatedAt;
  69.     /**
  70.      * @return int
  71.      */
  72.     public function getId()
  73.     {
  74.         return $this->id;
  75.     }
  76.     /**
  77.      * @param int $id
  78.      */
  79.     public function setId($id)
  80.     {
  81.         $this->id $id;
  82.     }
  83.     /**
  84.      * @return string
  85.      */
  86.     public function getDescription()
  87.     {
  88.         return $this->description;
  89.     }
  90.     /**
  91.      * @param string $description
  92.      */
  93.     public function setDescription($description)
  94.     {
  95.         $this->description $description;
  96.     }
  97.     /**
  98.      * @return ?string
  99.      */
  100.     public function getPrescription()
  101.     {
  102.         return $this->prescription;
  103.     }
  104.     /**
  105.      * @param string $description
  106.      */
  107.     public function setPrescription($prescription)
  108.     {
  109.         $this->prescription $prescription;
  110.     }
  111.     /**
  112.      * @return Intervention
  113.      */
  114.     public function getIntervention()
  115.     {
  116.         return $this->intervention;
  117.     }
  118.     /**
  119.      * @param Intervention $intervention
  120.      */
  121.     public function setIntervention($intervention)
  122.     {
  123.         $this->intervention $intervention;
  124.     }
  125.     /**
  126.      * @return Intervention
  127.      */
  128.     public function getClient()
  129.     {
  130.         return $this->client;
  131.     }
  132.     /**
  133.      * @param Client $client
  134.      */
  135.     public function setClient($client)
  136.     {
  137.         $this->client $client;
  138.     }
  139.     /**
  140.      * @return DateTime
  141.      */
  142.     public function getCreatedAt()
  143.     {
  144.         return $this->createdAt;
  145.     }
  146.     /**
  147.      * @param DateTime $createdAt
  148.      */
  149.     public function setCreatedAt(DateTime $createdAt)
  150.     {
  151.         $this->createdAt $createdAt;
  152.     }
  153.     /**
  154.      * @return DateTime|null
  155.      */
  156.     public function getUpdatedAt()
  157.     {
  158.         return $this->updatedAt;
  159.     }
  160.     /**
  161.      * @param DateTime|null $updatedAt
  162.      */
  163.     public function setUpdatedAt(?DateTime $updatedAt)
  164.     {
  165.         $this->updatedAt $updatedAt;
  166.     }
  167. }