| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182 |
- <?php
- namespace AppBundle\Entity\Booking;
- use AppBundle\Entity\Core\File;
- use AppBundle\Entity\Message\Message;
- use Doctrine\Common\Collections\ArrayCollection;
- use Doctrine\ORM\Mapping as ORM;
- use Dunglas\ApiBundle\Annotation\Iri;
- use Symfony\Component\Serializer\Annotation\Groups;
- use Symfony\Component\Validator\Constraints as Assert;
- use AppBundle\Entity\Traits\TimestampableEntity;
- use AppBundle\Entity\Traits\CreatorUpdaterEntity;
- /**
- * Compte-rendu d'un évènement Event
- *
- * @Iri("http://schema.org/EventReport")
- */
- #[ORM\Entity]
- class EventReport
- {
- use TimestampableEntity;
- use CreatorUpdaterEntity;
- /**
- * @var int
- */
- #[ORM\Column(type: 'integer')]
- #[ORM\Id]
- #[ORM\GeneratedValue(strategy: 'AUTO')]
- #[Groups(['eventreport', 'event_details'])]
- private $id;
- /**
- * @var Event
- */
- #[ORM\ManyToOne(targetEntity: 'Event', inversedBy: 'eventReports')]
- #[Groups(['eventreport'])]
- private $event;
- /**
- * @var string
- */
- #[ORM\Column(type: 'text', nullable: true)]
- #[Assert\Type(type: 'string')]
- #[Groups(['eventreport', 'event_details_eventreports'])]
- private $report;
- /**
- * @var \DateTime
- */
- #[ORM\Column(type: 'date', nullable: false)]
- #[Assert\Date]
- #[Assert\NotNull]
- #[Groups(['eventreport', 'event_details_eventreports'])]
- private $date;
- /**
- * @var ArrayCollection<AppBundle\Entity\Core\File>.
- */
- #[ORM\OneToMany(targetEntity: 'AppBundle\Entity\Core\File', mappedBy: 'eventReport', orphanRemoval: true)]
- #[Groups(['eventreport', 'event_details_eventreports'])]
- private $files;
- public function __construct() {
- $this->files = new ArrayCollection();
- }
- /**
- * Sets id.
- *
- * @param int $id
- *
- * @return $this
- */
- public function setId($id)
- {
- $this->id = $id;
- return $this;
- }
- /**
- * Gets id.
- *
- * @return int
- */
- public function getId()
- {
- return $this->id;
- }
- /**
- * Set report
- *
- * @param string $report
- *
- * @return EventReport
- */
- public function setReport($report)
- {
- $this->report = $report;
- return $this;
- }
- /**
- * Get report
- *
- * @return string
- */
- public function getReport()
- {
- return $this->report;
- }
- /**
- * Set date
- *
- * @param \DateTime $date
- *
- * @return EventReport
- */
- public function setDate($date)
- {
- $this->date = $date;
- return $this;
- }
- /**
- * Get date
- *
- * @return \DateTime
- */
- public function getDate()
- {
- return $this->date;
- }
- /**
- * Set event
- *
- * @param \AppBundle\Entity\Booking\Event $event
- *
- * @return EventReport
- */
- public function setEvent(\AppBundle\Entity\Booking\Event $event = null)
- {
- $this->event = $event;
- return $this;
- }
- /**
- * Get event
- *
- * @return \AppBundle\Entity\Booking\Event
- */
- public function getEvent()
- {
- return $this->event;
- }
- /**
- * Add file
- *
- * @param File $file
- *
- * @return Message
- */
- public function addFile(File $file)
- {
- $file->setEventReport($this);
- $this->files[] = $file;
- return $this;
- }
- /**
- * Remove file
- *
- * @param File $file
- */
- public function removeFile(File $file)
- {
- $this->files->removeElement($file);
- }
- /**
- * Get files
- *
- * @return \Doctrine\Common\Collections\Collection
- */
- public function getFiles()
- {
- return $this->files;
- }
- }
|