src/Entity/ContactPerson.php line 10

Open in your IDE?
  1. <?php
  2. namespace App\Entity;
  3. use Doctrine\ORM\Mapping as ORM;
  4. /**
  5.  * @ORM\Entity(repositoryClass="App\Repository\ContactPersonRepository")
  6.  */
  7. class ContactPerson
  8. {
  9.     /**
  10.      * @ORM\Id()
  11.      * @ORM\GeneratedValue()
  12.      * @ORM\Column(type="integer")
  13.      */
  14.     private $id;
  15.     /**
  16.      * @ORM\Column(type="string", length=255, nullable=true)
  17.      */
  18.     private $name;
  19.     /**
  20.      * @ORM\Column(type="string", length=255, nullable=true)
  21.      */
  22.     private $phoneNumber;
  23.     /**
  24.      * @ORM\ManyToOne(targetEntity="App\Entity\Customer", inversedBy="persons", cascade={"remove","persist"})
  25.      * @ORM\JoinColumn(name="customer_id", referencedColumnName="id", nullable=false)
  26.      */
  27.     private $customer;
  28.     /**
  29.      * @ORM\Column(type="boolean")
  30.      */
  31.     private $defaultPerson false;
  32.     /**
  33.      * @ORM\Column(type="boolean", options={"default" : true})
  34.      */
  35.     private $active false;
  36.     public function getId(): ?int
  37.     {
  38.         return $this->id;
  39.     }
  40.     public function setName($name): void
  41.     {
  42.         $this->name $name;
  43.     }
  44.     public function getName()
  45.     {
  46.         return $this->name;
  47.     }
  48.     public function setPhoneNumber($phoneNumber): void
  49.     {
  50.         $this->phoneNumber $phoneNumber;
  51.     }
  52.     public function getPhoneNumber()
  53.     {
  54.         return $this->phoneNumber;
  55.     }
  56.     public function getCustomer()
  57.     {
  58.         return $this->customer;
  59.     }
  60.     public function setCustomer($customer): void
  61.     {
  62.         $this->customer $customer;
  63.     }
  64.     public function isDefaultPerson(): bool
  65.     {
  66.         return $this->defaultPerson;
  67.     }
  68.     public function setDefaultPerson(bool $defaultPerson): void
  69.     {
  70.         $this->defaultPerson $defaultPerson;
  71.     }
  72.     public function __toString()
  73.     {
  74.         return $this->name ', ' $this->phoneNumber;
  75.     }
  76.     public function getActive()
  77.     {
  78.         return $this->active;
  79.     }
  80.     public function setActive(bool $active)
  81.     {
  82.         $this->active $active;
  83.     }
  84. }