Deprecated: Constant E_STRICT is deprecated in /var/www/PixelForce/vendor/symfony/error-handler/ErrorHandler.php on line 58

Deprecated: Constant E_STRICT is deprecated in /var/www/PixelForce/vendor/symfony/error-handler/ErrorHandler.php on line 76
Symfony Profiler

src/Entity/Meeting.php line 153

Open in your IDE?
  1. <?php
  2. namespace App\Entity;
  3. use App\Repository\MeetingRepository;
  4. use Doctrine\DBAL\Types\Types;
  5. use Doctrine\ORM\Mapping as ORM;
  6. use JsonSerializable;
  7. use Symfony\Component\Validator\Constraints as Assert;
  8. /**
  9.  * @ORM\Entity(repositoryClass=MeetingRepository::class)
  10.  */
  11. class Meeting implements JsonSerializable
  12. {
  13.     /**
  14.      * @ORM\Id
  15.      * @ORM\GeneratedValue
  16.      * @ORM\Column(type="integer")
  17.      */
  18.     private $id;
  19.     /**
  20.      * @ORM\Column(type="string", length=255)
  21.      */
  22.     private $title;
  23.     /**
  24.      * @ORM\Column(type="string", nullable=true)
  25.      */
  26.     private $note;
  27.     /**
  28.      * @ORM\Column(type="datetime", nullable=true)
  29.      * @Assert\GreaterThan("today", message="La date de début doit être ultérieure à la date d'aujourd'hui !")
  30.      */
  31.     private $start;
  32.     /**
  33.      * @ORM\Column(type="datetime", nullable=true)
  34.      * @Assert\GreaterThan(propertyPath="start", message="La date de fin doit être plus éloignée que la date de début !")
  35.      */
  36.     private $end;
  37.      /**
  38.      * @ORM\ManyToOne(targetEntity="User", inversedBy="meetings")
  39.      * @ORM\JoinColumn(name="user_id", referencedColumnName="id")
  40.      */
  41.     private $user;
  42.     /**
  43.      * @ORM\ManyToOne(targetEntity=Audit::class)
  44.      * @ORM\JoinColumn(name="audit_id", referencedColumnName="id", nullable=true)
  45.      */
  46.     private $audit;
  47.      /**
  48.      * @ORM\ManyToOne(targetEntity="MeetingState", inversedBy="meetings")
  49.      * @ORM\JoinColumn(name="meeting_state_id", referencedColumnName="id")
  50.      */
  51.     private $meetingState;
  52.     /**
  53.      * @ORM\ManyToOne(targetEntity=Contact::class, inversedBy="meetings")
  54.      * @ORM\JoinColumn(nullable=false)
  55.      */
  56.     private $userToMeet;
  57.     /**
  58.         * @ORM\ManyToOne(targetEntity=Secteur::class, inversedBy="agentSecteurs",fetch="EAGER")
  59.     */
  60.     private $secteur;
  61.     public function getId(): ?int
  62.     {
  63.         return $this->id;
  64.     }
  65.     public function getTitle(): ?string
  66.     {
  67.         return $this->title;
  68.     }
  69.     public function setTitle(string $title): self
  70.     {
  71.         $this->title $title;
  72.         return $this;
  73.     }
  74.     public function getNote(): ?string
  75.     {
  76.         return $this->note;
  77.     }
  78.     public function setNote(?string $note): self
  79.     {
  80.         $this->note $note;
  81.         return $this;
  82.     }
  83.     public function getStart(): ?\DateTimeInterface
  84.     {
  85.         return $this->start;
  86.     }
  87.     public function setStart(?\DateTimeInterface $start): self
  88.     {
  89.         $this->start $start;
  90.         return $this;
  91.     }
  92.     public function getEnd(): ?\DateTimeInterface
  93.     {
  94.         return $this->end;
  95.     }
  96.     public function setEnd(?\DateTimeInterface $end): self
  97.     {
  98.         $this->end $end;
  99.         return $this;
  100.     }
  101.     public function getUser(): ?User
  102.     {
  103.         return $this->user;
  104.     }
  105.     public function setUser(User $user): self
  106.     {
  107.         $this->user $user;
  108.         return $this;
  109.     }
  110.     public function getMeetingState(): ?MeetingState
  111.     {
  112.         return $this->meetingState;
  113.     }
  114.     public function setMeetingState(?MeetingState $meetingState): self
  115.     {
  116.         $this->meetingState $meetingState;
  117.         return $this;
  118.     }
  119.     public function jsonSerialize()
  120.     {
  121.         $vars get_object_vars($this);
  122.         return $vars;
  123.     }
  124.     public function toCalendarEvent(bool $is_coach=false): ?CalendarEvent
  125.     {
  126.         $firstUrl $is_coach 'coach' 'agent';
  127.         $event = new CalendarEvent();
  128.         $event->setTitle($this->getTitle());
  129.         $event->setStart($this->getStart());
  130.         $event->setEnd($this->getEnd());
  131.         $event->setAllDay(false);
  132.         $event->setUrl("/".$firstUrl."/contact/meeting/".$this->getId()."/fiche");
  133.         return $event;
  134.     }
  135.     public function clone(): ?Meeting
  136.     {
  137.         $meeting = new Meeting();
  138.         $meeting->setTitle($this->getTitle());
  139.         $meeting->setNote($this->getNote());
  140.         $meeting->setStart($this->getStart());
  141.         $meeting->setEnd($this->getEnd());
  142.         return $meeting;
  143.     }
  144.     public function getUserToMeet(): ?Contact
  145.     {
  146.         return $this->userToMeet;
  147.     }
  148.     public function setUserToMeet(?Contact $userToMeet): self
  149.     {
  150.         $this->userToMeet $userToMeet;
  151.         return $this;
  152.     }
  153.     public function getAudit(): ?Audit
  154.     {
  155.         return $this->audit;
  156.     }
  157.     public function setAudit(?Audit $audit): static
  158.     {
  159.         $this->audit $audit;
  160.         return $this;
  161.     }
  162.     /**
  163.      * Get the value of secteur
  164.      */ 
  165.     public function getSecteur()
  166.     {
  167.         return $this->secteur;
  168.     }
  169.     /**
  170.      * Set the value of secteur
  171.      *
  172.      * @return  self
  173.      */ 
  174.     public function setSecteur($secteur)
  175.     {
  176.         $this->secteur $secteur;
  177.         return $this;
  178.     }
  179. }