<?php
namespace App\Entity;
use Doctrine\ORM\Mapping as ORM;
use App\Entity\Intervention;
use ApiPlatform\Core\Annotation\ApiResource;
use App\Repository\OrdonnanceRepository;
use App\Entity\Client;
use DateTime;
use Symfony\Component\Serializer\Annotation\Groups;
/**
* @ApiResource
* @ORM\Table()
* @ORM\Entity(repositoryClass=OrdonnanceRepository::class)
*/
class Ordonnance
{
/**
* @var integer $id
*
* @ORM\Id
* @ORM\Column(type="integer")
* @ORM\GeneratedValue(strategy="AUTO")
*
* @Groups({"read"})
*/
private $id;
/**
* @var string
*
* @ORM\Column(name="description", type="text", nullable=true)
*
*/
private $description;
/**
* @var string
*
* @ORM\Column(name="prescription", type="json", nullable=true)
*
*/
private $prescription;
/**
* @var Intervention
* @ORM\ManyToOne(
* targetEntity=Intervention::class, inversedBy="ordonnances"
* )
* @Groups({"read"})
*/
private $intervention;
/**
* @var Intervention
* @ORM\ManyToOne(
* targetEntity=Client::class
* )
* @Groups({"read"})
*/
private $client;
/**
* @var DateTime
*
* @ORM\Column(name="createdAt", type="datetime", options={"default": "CURRENT_TIMESTAMP"})
*/
private $createdAt;
/**
* @var DateTime
*
* @ORM\Column(name="updatedAt", type="datetime", options={"default": "CURRENT_TIMESTAMP"}, nullable=true)
*/
private $updatedAt;
/**
* @return int
*/
public function getId()
{
return $this->id;
}
/**
* @param int $id
*/
public function setId($id)
{
$this->id = $id;
}
/**
* @return string
*/
public function getDescription()
{
return $this->description;
}
/**
* @param string $description
*/
public function setDescription($description)
{
$this->description = $description;
}
/**
* @return ?string
*/
public function getPrescription()
{
return $this->prescription;
}
/**
* @param string $description
*/
public function setPrescription($prescription)
{
$this->prescription = $prescription;
}
/**
* @return Intervention
*/
public function getIntervention()
{
return $this->intervention;
}
/**
* @param Intervention $intervention
*/
public function setIntervention($intervention)
{
$this->intervention = $intervention;
}
/**
* @return Intervention
*/
public function getClient()
{
return $this->client;
}
/**
* @param Client $client
*/
public function setClient($client)
{
$this->client = $client;
}
/**
* @return DateTime
*/
public function getCreatedAt()
{
return $this->createdAt;
}
/**
* @param DateTime $createdAt
*/
public function setCreatedAt(DateTime $createdAt)
{
$this->createdAt = $createdAt;
}
/**
* @return DateTime|null
*/
public function getUpdatedAt()
{
return $this->updatedAt;
}
/**
* @param DateTime|null $updatedAt
*/
public function setUpdatedAt(?DateTime $updatedAt)
{
$this->updatedAt = $updatedAt;
}
}