<?php
namespace App\Entity;
use Doctrine\ORM\Mapping as ORM;
use Symfony\Component\Validator\Constraints as Assert;
use App\Entity\Docteur;
use App\Entity\Laboratoire;
use App\Entity\Client;
use App\Entity\SpecialiteDocteur;
use App\Entity\SpecialiteLaboratoire;
use ApiPlatform\Core\Annotation\ApiResource;
use Symfony\Component\Serializer\Annotation\Groups;
use Doctrine\Common\Collections\ArrayCollection;
/**
* AnalyticPhone
*
* @ORM\Table()
* @ORM\Entity(repositoryClass="App\Entity\AnalyticPhoneRepository")
* @ApiResource(
* attributes={
* "force_eager"=false,
* "normalization_context"={"groups"={"read", "user", "media"}},
* "denormalization_context"={"groups"={"read", "user", "media"}}
* }
* )
*/
class AnalyticPhone
{
/**
* @var int
*
* @ORM\Column(name="id", type="integer")
* @ORM\Id
* @ORM\GeneratedValue(strategy="AUTO")
*
* @Groups({"read"})
*/
private $id;
/**
* @var string
*
* @ORM\Column(name="type", type="string", length=30)
*
* @Assert\NotBlank()
* @Groups({"read"})
*/
private $type;
/**
* @var string
*
* @ORM\Column(name="typeUser", type="string", length=30)
*
* @Assert\NotBlank()
* @Groups({"read"})
*/
private $typeUser;
/**
* @var datetime
*
* @ORM\Column(name="horodateCreation", type="datetime")
*
* @Assert\NotBlank()
* @Groups({"read"})
*/
private $horodateCreation;
/**
* @var ArrayCollection
*
* @ORM\ManyToOne(
* targetEntity="App\Entity\Docteur",
* cascade={"persist"}
* )
* @Groups({"read"})
*/
private $docteur;
/**
* @var ArrayCollection
*
* @ORM\ManyToOne(
* targetEntity=Laboratoire::class,
* cascade={"persist"}
* )
* @Groups({"read"})
*/
private $laboratoire;
/**
* @var ArrayCollection
*
* @ORM\ManyToOne(
* targetEntity=Client::class,
* cascade={"persist"}
* )
* @Groups({"read"})
*/
private $client;
/**
* @var stdClass
*
* @ORM\ManyToOne(
* targetEntity="App\Entity\SpecialiteDocteur",
* cascade={"persist"}
* )
* @Groups({"read"})
*/
private $specialiteDocteur;
/**
* @var stdClass
*
* @ORM\ManyToOne(
* targetEntity="App\Entity\SpecialiteLaboratoire",
* cascade={"persist"}
* )
* @Groups({"read"})
*/
private $specialiteLaboratoire;
/**
* Constructor of AnalyticPhone Entity
*/
public function __construct()
{
$this->horodateCreation = new \DateTime;
}
public function __toString()
{
return ($this->getClient()) ? $this->getClient(). ' - '. $this->getType(). ' - '. $this->getTypeUser() : $this->getId() . ' - '. $this->getType(). ' - '. $this->getType();
}
/**
* Get id
*
* @return integer
*/
public function getId()
{
return $this->id;
}
/**
* Get type
*
* @return string
*/
public function getType()
{
return $this->type;
}
/**
* Set type
*
* @param string $type
*
* @return AnalyticPhone
*/
public function setType($type)
{
$this->type = $type;
return $this;
}
/**
* Get typeUser
*
* @return string
*/
public function getTypeUser()
{
return $this->typeUser;
}
/**
* Set typeUser
*
* @param string $typeUser
*
* @return AnalyticPhone
*/
public function setTypeUser($typeUser)
{
$this->typeUser = $typeUser;
return $this;
}
/**
* Get horodateCreation
*
* @return datetime
*/
public function getHorodateCreation()
{
return $this->horodateCreation;
}
/**
* Set horodateCreation
*
* @param datetime $horodateCreation
*
* @return AnalyticPhone
*/
public function setHorodateCreation($horodateCreation)
{
$this->horodateCreation = $horodateCreation;
return $this;
}
/**
* Get getDateInfoString
*
* @return \DateTime
* @Groups({"read"})
*/
public function getDateInfoString()
{
return $this->horodateCreation->format('Y-m-d');
}
/**
* Get getDateTimeInfoString
*
* @return \DateTime
* @Groups({"read"})
*/
public function getDateTimeInfoString()
{
return $this->horodateCreation->format('c');
}
/**
* Get docteur
*
* @return stdClass
*/
public function getDocteur()
{
return $this->docteur;
}
/**
* Set docteur
*
* @param Docteur $docteur
*
* @return AnalyticPhone
*/
public function setDocteur(Docteur $docteur)
{
$this->docteur = $docteur;
return $this;
}
/**
* Get laboratoire
*
* @return stdClass
*/
public function getLaboratoire()
{
return $this->laboratoire;
}
/**
* Set laboratoire
*
* @param Laboratoire $laboratoire
*
* @return AnalyticPhone
*/
public function setLaboratoire(Laboratoire $laboratoire)
{
$this->laboratoire = $laboratoire;
return $this;
}
/**
* Get client
*
* @return stdClass
*/
public function getClient()
{
return $this->client;
}
/**
* Set client
*
* @param Client $client
*
* @return AnalyticPhone
*/
public function setClient(Client $client)
{
$this->client = $client;
return $this;
}
/**
* Get specialiteDocteur
*
* @return stdClass
*/
public function getSpecialiteDocteur()
{
return $this->specialiteDocteur;
}
/**
* Set specialiteDocteur
*
* @param SpecialiteDocteur $specialiteDocteur
*
* @return AnalyticPhone
*/
public function setSpecialiteDocteur(SpecialiteDocteur $specialiteDocteur)
{
$this->specialiteDocteur = $specialiteDocteur;
return $this;
}
/**
* Get specialiteLaboratoire
*
* @return stdClass
*/
public function getSpecialiteLaboratoire()
{
return $this->specialiteLaboratoire;
}
/**
* Set specialiteLaboratoire
*
* @param SpecialiteLaboratoire $specialiteLaboratoire
*
* @return AnalyticPhone
*/
public function setSpecialiteLaboratoire(SpecialiteLaboratoire $specialiteLaboratoire)
{
$this->specialiteLaboratoire = $specialiteLaboratoire;
return $this;
}
}