src/Entity/Members.php line 15

Open in your IDE?
  1. <?php
  2. namespace App\Entity;
  3. use Doctrine\Common\Collections\ArrayCollection;
  4. use Doctrine\Common\Collections\Collection;
  5. use Doctrine\ORM\Mapping as ORM;
  6. /**
  7.  * Pages
  8.  *
  9.  * @ORM\Table(name="Members")
  10.  * @ORM\Entity(repositoryClass="App\Repository\MembersRepository")
  11.  */
  12. class Members
  13. {
  14.     public function __construct(){
  15.                          $this->date = new \DateTime;
  16.                          $this->commissions = new ArrayCollection();
  17.                      }
  18.     /**
  19.      * @var int
  20.      *
  21.      * @ORM\Column(name="id", type="integer")
  22.      * @ORM\Id
  23.      * @ORM\GeneratedValue(strategy="AUTO")
  24.      */
  25.     private $id;
  26.     /**
  27.      * @ORM\Column(name="fname", type="string", length=255,nullable=true)
  28.      */
  29.     private $fName;
  30.     /**
  31.      * @ORM\Column(name="lname", type="string", length=255,nullable=true)
  32.      */
  33.     private $lName;
  34.     /**
  35.      * @ORM\OneToOne(targetEntity="App\Entity\Picture", cascade={"persist","remove"}, orphanRemoval=true)
  36.      * @ORM\JoinColumn(nullable=true)
  37.      */
  38.     private $picture;
  39.     /**
  40.      * @var \DateTime|null
  41.      *
  42.      * @ORM\Column(name="date", type="datetime", nullable=true)
  43.      */
  44.     private $date;
  45.     /**
  46.      * @ORM\ManyToOne(targetEntity="App\Entity\Users")
  47.      * @ORM\JoinColumn(name="createdBy",nullable=true)
  48.      */
  49.     private $createdBy;
  50.     /**
  51.      * @ORM\ManyToOne(targetEntity="App\Entity\Users")
  52.      * @ORM\JoinColumn(name="updatedBy",nullable=true)
  53.      */
  54.     private $updatedBy;
  55.     /**
  56.      * @var bool
  57.      *
  58.      * @ORM\Column(name="isEnabled", type="boolean",nullable=true)
  59.      */
  60.     private $isEnabled;
  61.     /**
  62.      * @ORM\Column(type="string", length=255, nullable=true)
  63.      */
  64.     private $title;
  65.     /**
  66.      * @ORM\Column(type="string", length=255, nullable=true)
  67.      */
  68.     private $profession;
  69.     public function getId(): ?int
  70.     {
  71.         return $this->id;
  72.     }
  73.     public function getFName(): ?string
  74.     {
  75.         return $this->fName;
  76.     }
  77.     public function setFName(?string $fName): self
  78.     {
  79.         $this->fName $fName;
  80.         return $this;
  81.     }
  82.     public function getLName(): ?string
  83.     {
  84.         return $this->lName;
  85.     }
  86.     public function setLName(?string $lName): self
  87.     {
  88.         $this->lName $lName;
  89.         return $this;
  90.     }
  91.     public function getLastUpdate(): ?\DateTimeInterface
  92.     {
  93.         return $this->lastUpdate;
  94.     }
  95.     public function setLastUpdate(\DateTimeInterface $lastUpdate): self
  96.     {
  97.         $this->lastUpdate $lastUpdate;
  98.         return $this;
  99.     }
  100.     public function getDate(): ?\DateTimeInterface
  101.     {
  102.         return $this->date;
  103.     }
  104.     public function setDate(?\DateTimeInterface $date): self
  105.     {
  106.         $this->date $date;
  107.         return $this;
  108.     }
  109.     public function getCreatedBy(): ?Users
  110.     {
  111.         return $this->createdBy;
  112.     }
  113.     public function setCreatedBy(?Users $createdBy): self
  114.     {
  115.         $this->createdBy $createdBy;
  116.         return $this;
  117.     }
  118.     public function getUpdatedBy(): ?Users
  119.     {
  120.         return $this->updatedBy;
  121.     }
  122.     public function setUpdatedBy(?Users $updatedBy): self
  123.     {
  124.         $this->updatedBy $updatedBy;
  125.         return $this;
  126.     }
  127.     public function getIsEnabled(): ?bool
  128.     {
  129.         return $this->isEnabled;
  130.     }
  131.     public function setIsEnabled(?bool $isEnabled): self
  132.     {
  133.         $this->isEnabled $isEnabled;
  134.         return $this;
  135.     }
  136.     public function getPicture(): ?Picture
  137.     {
  138.         return $this->picture;
  139.     }
  140.     public function setPicture(?Picture $picture): self
  141.     {
  142.         if($picture->getTarget()){
  143.             $this->picture $picture;
  144.             $this->picture->setDir('upload/images/members');
  145.             $this->picture->setThumbnailDir('upload/thumbnails/members');
  146.         }
  147.         return $this;
  148.     }
  149.     public function getTitle(): ?string
  150.     {
  151.         return $this->title;
  152.     }
  153.     public function setTitle(?string $title): self
  154.     {
  155.         $this->title $title;
  156.         return $this;
  157.     }
  158.     public function getName(){return $this->fName.' '.$this->lName;}
  159.     public function __toString(){return $this->getName();}
  160.     public function getProfession(): ?string
  161.     {
  162.         return $this->profession;
  163.     }
  164.     public function setProfession(?string $profession): self
  165.     {
  166.         $this->profession $profession;
  167.         return $this;
  168.     }
  169. }