<?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;
    }
}
