src/Admin/Modules/Contract/Entity/UserContractTrader.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_trader", indexes={@ORM\Index(columns={"first_name"}), @ORM\Index(columns={"last_name"})})
  7.  * @ORM\Entity
  8.  */
  9. class UserContractTrader
  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="contractTrader")
  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 string
  51.      *
  52.      * @ORM\Column(name="street", type="string", length=255, nullable=false)
  53.      */
  54.     private $street;
  55.     /**
  56.      * @var string
  57.      *
  58.      * @ORM\Column(name="building_number", type="string", length=10, nullable=false)
  59.      */
  60.     private $buildingNumber;
  61.     /**
  62.      * @var string
  63.      *
  64.      * @ORM\Column(name="apartment_number", type="string", length=10, nullable=true)
  65.      */
  66.     private $apartmentNumber;
  67.     /**
  68.      * @var string
  69.      *
  70.      * @ORM\Column(name="postal_code", type="string", length=10, nullable=false)
  71.      */
  72.     private $postalCode;
  73.     /**
  74.      * @var string
  75.      *
  76.      * @ORM\Column(name="city", type="string", length=255, nullable=false)
  77.      */
  78.     private $city;
  79.     /**
  80.      * @var \App\Modules\User\Entity\User
  81.      *
  82.      * @ORM\ManyToOne(targetEntity="App\Modules\User\Entity\User")
  83.      * @ORM\JoinColumns({
  84.      *   @ORM\JoinColumn(name="id_added_by", referencedColumnName="id", nullable=false, onDelete="CASCADE")
  85.      * })
  86.      */
  87.     private $addedBy;
  88.     
  89.     public function __toString()
  90.     {
  91.         return $this->firstName ' ' $this->lastName;
  92.     }
  93.     public function getId(): ?string
  94.     {
  95.         return $this->id;
  96.     }
  97.     
  98.     public function getNameWithId()
  99.     {
  100.         return $this->firstName ' ' $this->lastName ' (' $this->id ')';
  101.     }
  102.     public function getFirstName(): ?string
  103.     {
  104.         return $this->firstName;
  105.     }
  106.     public function setFirstName(string $firstName): self
  107.     {
  108.         $this->firstName $firstName;
  109.         return $this;
  110.     }
  111.     public function getLastName(): ?string
  112.     {
  113.         return $this->lastName;
  114.     }
  115.     public function setLastName(string $lastName): self
  116.     {
  117.         $this->lastName $lastName;
  118.         return $this;
  119.     }
  120.     public function getPhone(): ?string
  121.     {
  122.         return $this->phone;
  123.     }
  124.     public function setPhone(?string $phone): self
  125.     {
  126.         $this->phone $phone;
  127.         return $this;
  128.     }
  129.     public function getStreet(): ?string
  130.     {
  131.         return $this->street;
  132.     }
  133.     public function setStreet(string $street): self
  134.     {
  135.         $this->street $street;
  136.         return $this;
  137.     }
  138.     public function getBuildingNumber(): ?string
  139.     {
  140.         return $this->buildingNumber;
  141.     }
  142.     public function setBuildingNumber(string $buildingNumber): self
  143.     {
  144.         $this->buildingNumber $buildingNumber;
  145.         return $this;
  146.     }
  147.     public function getApartmentNumber(): ?string
  148.     {
  149.         return $this->apartmentNumber;
  150.     }
  151.     public function setApartmentNumber(?string $apartmentNumber): self
  152.     {
  153.         $this->apartmentNumber $apartmentNumber;
  154.         return $this;
  155.     }
  156.     public function getPostalCode(): ?string
  157.     {
  158.         return $this->postalCode;
  159.     }
  160.     public function setPostalCode(string $postalCode): self
  161.     {
  162.         $this->postalCode $postalCode;
  163.         return $this;
  164.     }
  165.     public function getCity(): ?string
  166.     {
  167.         return $this->city;
  168.     }
  169.     public function setCity(string $city): self
  170.     {
  171.         $this->city $city;
  172.         return $this;
  173.     }
  174.     public function getUser(): ?User
  175.     {
  176.         return $this->user;
  177.     }
  178.     public function setUser(?User $user): self
  179.     {
  180.         $this->user $user;
  181.         return $this;
  182.     }
  183.     public function getAddedBy(): ?User
  184.     {
  185.         return $this->addedBy;
  186.     }
  187.     public function setAddedBy(?User $addedBy): self
  188.     {
  189.         $this->addedBy $addedBy;
  190.         return $this;
  191.     }    
  192. }