<?phpnamespace App\Entity;use Doctrine\ORM\Mapping as ORM;/** * Meeting * * @ORM\Table(name="meeting") * @ORM\Entity(repositoryClass="App\Repository\MeetingRepository") */class Meeting{ /** * @var string * * @ORM\Column(name="id", type="string", length=50) * @ORM\Id */ private $id; /** * @var \DateTime * * @ORM\Column(name="date", type="datetime") */ private $date; /** * @ORM\ManyToOne(targetEntity="User") * @ORM\JoinColumn(nullable=true, onDelete="SET NULL") */ private $user; /** * @ORM\ManyToOne(targetEntity="House") */ private $house; /** * @ORM\OneToMany(targetEntity="SurveyCCAS", mappedBy="meeting") */ private $surveyCCASs; /** * @var string * * @ORM\Column(name="status", type="string", length=20) */ private $status; /** * @var bool * * @ORM\Column(name="firstVisit", type="boolean") */ private $firstVisit; private function random() { $characters = '0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ'; $charactersLength = strlen($characters); $randomString = ''; for ($i = 0; $i < 9; $i++) { $randomString .= $characters[rand(0, $charactersLength - 1)]; } return $randomString; } public function __construct() { $this->id = round(microtime(true) * 1000) . $this->random(); $this->firstVisit = true; $this->surveyCCASs = new \Doctrine\Common\Collections\ArrayCollection(); } /** * Set id * * @param string $id * * @return Meeting */ public function setId($id) { $this->id = $id; return $this; } /** * Get id * * @return string */ public function getId() { return $this->id; } /** * Set date * * @param \DateTime $date * * @return Meeting */ public function setDate($date) { $this->date = $date; return $this; } /** * Get date * * @return \DateTime */ public function getDate() { return $this->date; } /** * Set user * * @param integer $user * * @return Meeting */ public function setUser(\App\Entity\User $user) { $this->user = $user; return $this; } /** * Get user * * @return int */ public function getUser() { return $this->user; } /** * Set house * * @param integer $house * * @return Meeting */ public function setHouse(\App\Entity\House $house) { $this->house = $house; return $this; } /** * Get house * * @return int */ public function getHouse() { return $this->house; } /** * Set status * * @param string $status * * @return Meeting */ public function setStatus($status) { $this->status = $status; return $this; } /** * Get status * * @return string */ public function getStatus() { return $this->status; } /** * Set firstVisit * * @param boolean $firstVisit * * @return Meeting */ public function setFirstVisit($firstVisit) { $this->firstVisit = $firstVisit; return $this; } /** * Get firstVisit * * @return bool */ public function getFirstVisit() { return $this->firstVisit; } /** * Add surveyCCAS * * @param \App\Entity\SurveyCCAS $surveyCCAS * * @return Task */ public function addSurveyCCAS(\App\Entity\SurveyCCAS $surveyCCAS) { $this->surveyCCASs[] = $surveyCCAS; return $this; } /** * Remove surveyCCAS * * @param \App\Entity\SurveyCCAS $surveyCCAS */ public function removeSurveyCCAS(\App\Entity\SurveyCCAS $surveyCCAS) { $this->surveyCCASs->removeElement($surveyCCAS); } /** * Get surveyCCASs * * @return \Doctrine\Common\Collections\Collection */ public function getSurveyCCASs() { return $this->surveyCCASs; } }