src/Admin/Modules/Contract/Entity/UserContractSubstantiveDepartmentEmployee.php line 12

  1. <?php
  2. namespace App\Admin\Modules\Contract\Entity;
  3. use Doctrine\ORM\Mapping as ORM;
  4. use App\Modules\User\Entity\User;
  5. /**
  6.  * @ORM\Table(name="user_contract_substantive_department_employee", indexes={@ORM\Index(columns={"first_name"}), @ORM\Index(columns={"last_name"})})
  7.  * @ORM\Entity
  8.  */
  9. class UserContractSubstantiveDepartmentEmployee
  10. {
  11.     /**
  12.      * @var int
  13.      *
  14.      * @ORM\Column(type="integer")
  15.      * @ORM\Id
  16.      * @ORM\GeneratedValue(strategy="AUTO")
  17.      */
  18.     private $id;
  19.     
  20.     /**
  21.      * @var \App\Modules\User\Entity\User
  22.      *
  23.      * @ORM\ManyToOne(targetEntity="App\Modules\User\Entity\User", inversedBy="contractSubstantiveDepartmentEmployee")
  24.      * @ORM\JoinColumns({
  25.      *   @ORM\JoinColumn(name="id_user", referencedColumnName="id", nullable=false, onDelete="CASCADE")
  26.      * })
  27.      */
  28.     private $user;
  29.     
  30.     /**
  31.      * @var string
  32.      *
  33.      * @ORM\Column(name="first_name", type="string", length=255, nullable=false, options={"collation"="utf8_unicode_ci"})
  34.      */
  35.     private $firstName;    
  36.     
  37.     /**
  38.      * @var string
  39.      *
  40.      * @ORM\Column(name="last_name", type="string", length=255, nullable=false, options={"collation"="utf8_unicode_ci"})
  41.      */
  42.     private $lastName;
  43.     /**
  44.      * @var string
  45.      *
  46.      * @ORM\Column(name="phone", type="string", length=25, nullable=true)
  47.      */
  48.     private $phone;
  49.     /**
  50.      * @var \App\Modules\User\Entity\User
  51.      *
  52.      * @ORM\ManyToOne(targetEntity="App\Modules\User\Entity\User")
  53.      * @ORM\JoinColumns({
  54.      *   @ORM\JoinColumn(name="id_added_by", referencedColumnName="id", nullable=false, onDelete="CASCADE")
  55.      * })
  56.      */
  57.     private $addedBy;
  58.     
  59.     public function __toString()
  60.     {
  61.         return $this->firstName ' ' $this->lastName;
  62.     }
  63.     public function getId(): ?string
  64.     {
  65.         return $this->id;
  66.     }
  67.     
  68.     public function getNameWithId()
  69.     {
  70.         return $this->firstName ' ' $this->lastName ' (' $this->id ')';
  71.     }
  72.     public function getFirstName(): ?string
  73.     {
  74.         return $this->firstName;
  75.     }
  76.     public function setFirstName(string $firstName): self
  77.     {
  78.         $this->firstName $firstName;
  79.         return $this;
  80.     }
  81.     public function getLastName(): ?string
  82.     {
  83.         return $this->lastName;
  84.     }
  85.     public function setLastName(string $lastName): self
  86.     {
  87.         $this->lastName $lastName;
  88.         return $this;
  89.     }
  90.     public function getPhone(): ?string
  91.     {
  92.         return $this->phone;
  93.     }
  94.     public function setPhone(?string $phone): self
  95.     {
  96.         $this->phone $phone;
  97.         return $this;
  98.     }
  99.     public function getUser(): ?User
  100.     {
  101.         return $this->user;
  102.     }
  103.     public function setUser(?User $user): self
  104.     {
  105.         $this->user $user;
  106.         return $this;
  107.     }
  108.     public function getAddedBy(): ?User
  109.     {
  110.         return $this->addedBy;
  111.     }
  112.     public function setAddedBy(?User $addedBy): self
  113.     {
  114.         $this->addedBy $addedBy;
  115.         return $this;
  116.     }    
  117. }