src/Entity/Contact.php line 12

Open in your IDE?
  1. <?php
  2. namespace App\Entity;
  3. use App\Entity\Traits\ToArray;
  4. use App\Repository\ContactRepository;
  5. use Doctrine\ORM\Mapping as ORM;
  6. /**
  7.  * @ORM\Entity(repositoryClass=ContactRepository::class)
  8.  */
  9. class Contact
  10. {
  11.     use ToArray;
  12.     /**
  13.      * @ORM\Id
  14.      * @ORM\GeneratedValue
  15.      * @ORM\Column(type="integer")
  16.      */
  17.     private $id;
  18.     /**
  19.      * @ORM\Column(type="datetime")
  20.      */
  21.     private $createdAt;
  22.     /**
  23.      * @ORM\ManyToOne(targetEntity=User::class, inversedBy="contacts")
  24.      * @ORM\JoinColumn(nullable=false)
  25.      */
  26.     private $owner;
  27.     /**
  28.      * @ORM\ManyToOne(targetEntity=User::class)
  29.      * @ORM\JoinColumn(nullable=false)
  30.      */
  31.     private $contact;
  32.     /**
  33.      * @ORM\Column(type="string", length=255, nullable=true)
  34.      */
  35.     private $displayName;
  36.     public function __construct()
  37.     {
  38.         $this->createdAt = new \DateTime();
  39.     }
  40.     public function getId(): ?int
  41.     {
  42.         return $this->id;
  43.     }
  44.     public function getCreatedAt(): ?\DateTimeInterface
  45.     {
  46.         return $this->createdAt;
  47.     }
  48.     public function setCreatedAt(\DateTimeInterface $createdAt): self
  49.     {
  50.         $this->createdAt $createdAt;
  51.         return $this;
  52.     }
  53.     public function getOwner(): ?User
  54.     {
  55.         return $this->owner;
  56.     }
  57.     public function setOwner(?User $owner): self
  58.     {
  59.         $this->owner $owner;
  60.         return $this;
  61.     }
  62.     public function getContact(): ?User
  63.     {
  64.         return $this->contact;
  65.     }
  66.     public function setContact(?User $contact): self
  67.     {
  68.         $this->contact $contact;
  69.         return $this;
  70.     }
  71.     public function getDisplayName(): ?string
  72.     {
  73.         return $this->displayName;
  74.     }
  75.     public function setDisplayName(?string $displayName): self
  76.     {
  77.         $this->displayName $displayName;
  78.         return $this;
  79.     }
  80. }