src/Admin/Modules/MeetingScheduler/Entity/Meeting.php line 14

  1. <?php
  2. namespace App\Admin\Modules\MeetingScheduler\Entity;
  3. use App\Admin\Modules\Voucher\Entity\VoucherPackageVoucher;
  4. use Doctrine\DBAL\Types\Types;
  5. use Doctrine\ORM\Mapping as ORM;
  6. use App\Modules\User\Entity\User;
  7. /**
  8.  * @ORM\Table(name="meeting", indexes={@ORM\Index(columns={"first_name"}), @ORM\Index(columns={"last_name"}), @ORM\Index(columns={"is_reserved"}), @ORM\Index(columns={"date_from"}), @ORM\Index(columns={"date_to"})})
  9.  * @ORM\Entity(repositoryClass="App\Admin\Modules\MeetingScheduler\Repository\MeetingRepository")
  10.  */
  11. class Meeting
  12. {
  13.     /**
  14.      * @var int
  15.      *
  16.      * @ORM\Column(type="bigint", options={"unsigned"=true}))
  17.      * @ORM\Id
  18.      * @ORM\GeneratedValue(strategy="AUTO")
  19.      */
  20.     protected $id;
  21.     
  22.     /**
  23.      * @var \App\Admin\Modules\MeetingScheduler\Entity\MeetingCategory
  24.      *
  25.      * @ORM\ManyToOne(targetEntity="App\Admin\Modules\MeetingScheduler\Entity\MeetingCategory")
  26.      * @ORM\JoinColumns({
  27.      *   @ORM\JoinColumn(name="id_meeting_cateogry", referencedColumnName="id", nullable=true, onDelete="SET NULL")
  28.      * })
  29.      */
  30.     private $category;    
  31.     /**
  32.      * @var \App\Admin\Modules\MeetingScheduler\Entity\MeetingCategory
  33.      *
  34.      * @ORM\ManyToOne(targetEntity="App\Admin\Modules\MeetingScheduler\Entity\MeetingCategory")
  35.      * @ORM\JoinColumns({
  36.      *   @ORM\JoinColumn(name="id_meeting_cateogry_service", referencedColumnName="id", nullable=true, onDelete="SET NULL")
  37.      * })
  38.      */
  39.     private $categoryService;    
  40.     /**
  41.      * @var \App\Admin\Modules\Voucher\Entity\VoucherPackageVoucher
  42.      *
  43.      * @ORM\ManyToOne(targetEntity="App\Admin\Modules\Voucher\Entity\VoucherPackageVoucher", inversedBy="meeting")
  44.      * @ORM\JoinColumns({
  45.      *   @ORM\JoinColumn(name="id_voucher_package_voucher", referencedColumnName="id", nullable=true, onDelete="SET NULL")
  46.      * })
  47.      */
  48.     private $voucher;
  49.     /**
  50.      * @var string
  51.      *
  52.      * @ORM\Column(name="company_name", type="string", length=255, nullable=true)
  53.      */
  54.     private $companyName;
  55.     /**
  56.      * @var string
  57.      *
  58.      * @ORM\Column(name="tin", type="string", length=25, nullable=true)
  59.      */
  60.     private $tin;
  61.     /**
  62.      * @var string
  63.      *
  64.      * @ORM\Column(name="first_name", type="string", length=255, nullable=true)
  65.      */
  66.     private $firstName;
  67.     
  68.     /**
  69.      * @var string
  70.      *
  71.      * @ORM\Column(name="last_name", type="string", length=255, nullable=true)
  72.      */
  73.     private $lastName;
  74.     /**
  75.      * @var string
  76.      *
  77.      * @ORM\Column(name="email", type="string", length=255, nullable=true)
  78.      */
  79.     private $email;
  80.     /**
  81.      * @var string
  82.      *
  83.      * @ORM\Column(name="phone", type="string", length=25, nullable=true)
  84.      */
  85.     private $phone;
  86.     /**
  87.      * @var string
  88.      *
  89.      * @ORM\Column(name="address", type="string", length=255, nullable=true)
  90.      */
  91.     private $address;
  92.     /**
  93.      * @var string
  94.      *
  95.      * @ORM\Column(name="postal_code", type="string", length=6, nullable=true)
  96.      */
  97.     private $postalCode;
  98.     /**
  99.      * @var string
  100.      *
  101.      * @ORM\Column(name="city", type="string", length=255, nullable=true)
  102.      */
  103.     private $city;
  104.     /**
  105.      * @var string
  106.      *
  107.      * @ORM\Column(name="description", type="string", length=2048, nullable=true)
  108.      */
  109.     private $description;
  110.     /**
  111.      * @var \DateTime
  112.      *
  113.      * @ORM\Column(name="is_reserved", type="boolean", nullable=false)
  114.      */
  115.     private $isReserved;    
  116.     
  117.     /**
  118.      * @var \DateTime
  119.      *
  120.      * @ORM\Column(name="date_from", type="datetime", nullable=false)
  121.      */
  122.     private $dateFrom;
  123.     /**
  124.      * @var \DateTime
  125.      *
  126.      * @ORM\Column(name="date_to", type="datetime", nullable=false)
  127.      */
  128.     private $dateTo;
  129.     /**
  130.      * @var \App\Modules\User\Entity\User
  131.      *
  132.      * @ORM\ManyToOne(targetEntity="App\Modules\User\Entity\User")
  133.      * @ORM\JoinColumns({
  134.      *   @ORM\JoinColumn(name="id_added_by", referencedColumnName="id", nullable=false, onDelete="CASCADE")
  135.      * })
  136.      */
  137.     private $addedBy;
  138.     
  139.     public function __construct()
  140.     {
  141.         $this->isReserved false;
  142.     }
  143.     
  144.     public function getId(): ?string
  145.     {
  146.         return $this->id;
  147.     }
  148.     
  149.     public function getDisplayName()
  150.     {
  151.         if ($this->firstName != '' || $this->lastName != '')
  152.             return trim($this->firstName ' ' $this->lastName);
  153.         elseif ($this->email != '')
  154.             return $this->email;
  155.         elseif ($this->phone != '')
  156.             return $this->phone;
  157.         else
  158.         {
  159.             $address $this->getAddress();
  160.             if ($this->postalCode != '')
  161.                 $address .= ($address != '' ', ' '') . $this->postalCode;
  162.             if ($this->city != '')
  163.                 $address .= ($address != '' ? ($this->postalCode != '' ' ' ', ') : '') . $this->city;
  164.             
  165.             return $address;
  166.         }
  167.     }
  168.     public function getFirstName(): ?string
  169.     {
  170.         return $this->firstName;
  171.     }
  172.     public function setFirstName(?string $firstName): self
  173.     {
  174.         $this->firstName $firstName;
  175.         return $this;
  176.     }
  177.     public function getLastName(): ?string
  178.     {
  179.         return $this->lastName;
  180.     }
  181.     public function setLastName(?string $lastName): self
  182.     {
  183.         $this->lastName $lastName;
  184.         return $this;
  185.     }
  186.     public function getEmail(): ?string
  187.     {
  188.         return $this->email;
  189.     }
  190.     public function setEmail(?string $email): self
  191.     {
  192.         $this->email $email;
  193.         return $this;
  194.     }
  195.     public function getPhone(): ?string
  196.     {
  197.         return $this->phone;
  198.     }
  199.     public function setPhone(?string $phone): self
  200.     {
  201.         $this->phone $phone;
  202.         return $this;
  203.     }
  204.     public function getAddress(): ?string
  205.     {
  206.         return $this->address;
  207.     }
  208.     public function setAddress(?string $address): self
  209.     {
  210.         $this->address $address;
  211.         return $this;
  212.     }
  213.     public function getPostalCode(): ?string
  214.     {
  215.         return $this->postalCode;
  216.     }
  217.     public function setPostalCode(?string $postalCode): self
  218.     {
  219.         $this->postalCode $postalCode;
  220.         return $this;
  221.     }
  222.     public function getCity(): ?string
  223.     {
  224.         return $this->city;
  225.     }
  226.     public function setCity(?string $city): self
  227.     {
  228.         $this->city $city;
  229.         return $this;
  230.     }
  231.     public function getDescription(): ?string
  232.     {
  233.         return $this->description;
  234.     }
  235.     public function setDescription(?string $description): self
  236.     {
  237.         $this->description $description;
  238.         return $this;
  239.     }
  240.     public function getDateFrom(): ?\DateTimeInterface
  241.     {
  242.         return $this->dateFrom;
  243.     }
  244.     public function setDateFrom(\DateTimeInterface $dateFrom): self
  245.     {
  246.         $this->dateFrom $dateFrom;
  247.         return $this;
  248.     }
  249.     public function getDateTo(): ?\DateTimeInterface
  250.     {
  251.         return $this->dateTo;
  252.     }
  253.     public function setDateTo(\DateTimeInterface $dateTo): self
  254.     {
  255.         $this->dateTo $dateTo;
  256.         return $this;
  257.     }
  258.     public function getCategory(): ?MeetingCategory
  259.     {
  260.         return $this->category;
  261.     }
  262.     public function setCategory(?MeetingCategory $category): self
  263.     {
  264.         $this->category $category;
  265.         return $this;
  266.     }
  267.     public function getCategoryService(): ?MeetingCategory
  268.     {
  269.         return $this->categoryService;
  270.     }
  271.     public function setCategoryService(?MeetingCategory $categoryService): self
  272.     {
  273.         $this->categoryService $categoryService;
  274.         return $this;
  275.     }
  276.     public function getAddedBy(): ?User
  277.     {
  278.         return $this->addedBy;
  279.     }
  280.     public function setAddedBy(?User $addedBy): self
  281.     {
  282.         $this->addedBy $addedBy;
  283.         return $this;
  284.     }
  285.     public function getVoucher(): ?VoucherPackageVoucher
  286.     {
  287.         return $this->voucher;
  288.     }
  289.     public function setVoucher(?VoucherPackageVoucher $voucher): self
  290.     {
  291.         $this->voucher $voucher;
  292.         return $this;
  293.     }
  294.     public function getIsReserved(): ?bool
  295.     {
  296.         return $this->isReserved;
  297.     }
  298.     public function setIsReserved(bool $isReserved): self
  299.     {
  300.         $this->isReserved $isReserved;
  301.         return $this;
  302.     }
  303.     public function getCompanyName(): ?string
  304.     {
  305.         return $this->companyName;
  306.     }
  307.     public function setCompanyName(?string $companyName): self
  308.     {
  309.         $this->companyName $companyName;
  310.         return $this;
  311.     }
  312.     public function getTin(): ?string
  313.     {
  314.         return $this->tin;
  315.     }
  316.     public function setTin(?string $tin): self
  317.     {
  318.         $this->tin $tin;
  319.         return $this;
  320.     }
  321. }