src/Entity/Expert.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.  * Expert
  8.  *
  9.  * @ORM\Table(name="expert", indexes={@ORM\Index(name="IDX_4F1B9342E522CE8F", columns={"expertise_type_id"}), @ORM\Index(name="IDX_4F1B9342F92F3E70", columns={"country_id"})})
  10.  * @ORM\Entity
  11.  */
  12. class Expert
  13. {
  14.     /**
  15.      * @var int
  16.      *
  17.      * @ORM\Column(name="id", type="integer", nullable=false)
  18.      * @ORM\Id
  19.      * @ORM\GeneratedValue(strategy="IDENTITY")
  20.      */
  21.     private $id;
  22.     /**
  23.      * @var bool|null
  24.      *
  25.      * @ORM\Column(name="manager", type="boolean", nullable=true, options={"default"="NULL"})
  26.      */
  27.     private $manager;
  28.     /**
  29.      * @var string
  30.      *
  31.      * @ORM\Column(name="name", type="string", length=255, nullable=false)
  32.      */
  33.     private $name;
  34.     /**
  35.      * @var string
  36.      *
  37.      * @ORM\Column(name="firstname", type="string", length=255, nullable=false)
  38.      */
  39.     private $firstname;
  40.     /**
  41.      * @var string
  42.      *
  43.      * @ORM\Column(name="email", type="string", length=255, nullable=false)
  44.      */
  45.     private $email;
  46.     /**
  47.      * @var \ExpertiseType
  48.      *
  49.      * @ORM\ManyToOne(targetEntity="ExpertiseType")
  50.      * @ORM\JoinColumns({
  51.      *   @ORM\JoinColumn(name="expertise_type_id", referencedColumnName="id")
  52.      * })
  53.      */
  54.     private $expertiseType;
  55.     /**
  56.      * @var \Country
  57.      *
  58.      * @ORM\ManyToOne(targetEntity="Country")
  59.      * @ORM\JoinColumns({
  60.      *   @ORM\JoinColumn(name="country_id", referencedColumnName="id")
  61.      * })
  62.      */
  63.     private $country;
  64.     /**
  65.      * @var \Doctrine\Common\Collections\Collection
  66.      *
  67.      * @ORM\ManyToMany(targetEntity="GeneralSkill", inversedBy="expert")
  68.      * @ORM\JoinTable(name="expert_general_skill",
  69.      *   joinColumns={
  70.      *     @ORM\JoinColumn(name="expert_id", referencedColumnName="id")
  71.      *   },
  72.      *   inverseJoinColumns={
  73.      *     @ORM\JoinColumn(name="general_skill_id", referencedColumnName="id")
  74.      *   }
  75.      * )
  76.      */
  77.     private $generalSkill;
  78.     /**
  79.      * @var \Doctrine\Common\Collections\Collection
  80.      *
  81.      * @ORM\ManyToMany(targetEntity="Organism", inversedBy="expert")
  82.      * @ORM\JoinTable(name="expert_organism",
  83.      *   joinColumns={
  84.      *     @ORM\JoinColumn(name="expert_id", referencedColumnName="id")
  85.      *   },
  86.      *   inverseJoinColumns={
  87.      *     @ORM\JoinColumn(name="organism_id", referencedColumnName="id")
  88.      *   }
  89.      * )
  90.      */
  91.     private $organism;
  92.     /**
  93.      * @ORM\Column(type="boolean", nullable=true)
  94.      */
  95.     private $isAdmin;
  96.     /**
  97.      * @ORM\Column(type="string", length=255, nullable=true)
  98.      */
  99.     private $orcid;
  100.     /**
  101.      * Constructor
  102.      */
  103.     public function __construct()
  104.     {
  105.         $this->generalSkill = new \Doctrine\Common\Collections\ArrayCollection();
  106.         $this->organism = new \Doctrine\Common\Collections\ArrayCollection();
  107.     }
  108.     public function __toString() { return $this->name." ".$this->firstname;}
  109.     public function getId(): ?int
  110.                       {
  111.                           return $this->id;
  112.                       }
  113.     public function isManager(): ?bool
  114.     {
  115.         return $this->manager;
  116.     }
  117.     public function setManager(?bool $manager): self
  118.     {
  119.         $this->manager $manager;
  120.         return $this;
  121.     }
  122.     public function getName(): ?string
  123.     {
  124.         return $this->name;
  125.     }
  126.     public function setName(string $name): self
  127.     {
  128.         $this->name $name;
  129.         return $this;
  130.     }
  131.     public function getFirstname(): ?string
  132.     {
  133.         return $this->firstname;
  134.     }
  135.     public function setFirstname(string $firstname): self
  136.     {
  137.         $this->firstname $firstname;
  138.         return $this;
  139.     }
  140.     public function getEmail(): ?string
  141.     {
  142.         return $this->email;
  143.     }
  144.     public function setEmail(string $email): self
  145.     {
  146.         $this->email $email;
  147.         return $this;
  148.     }
  149.     public function getExpertiseType(): ?ExpertiseType
  150.     {
  151.         return $this->expertiseType;
  152.     }
  153.     public function setExpertiseType(?ExpertiseType $expertiseType): self
  154.     {
  155.         $this->expertiseType $expertiseType;
  156.         return $this;
  157.     }
  158.     public function getCountry(): ?Country
  159.     {
  160.         return $this->country;
  161.     }
  162.     public function setCountry(?Country $country): self
  163.     {
  164.         $this->country $country;
  165.         return $this;
  166.     }
  167.     /**
  168.      * @return Collection<int, GeneralSkill>
  169.      */
  170.     public function getGeneralSkill(): Collection
  171.     {
  172.         return $this->generalSkill;
  173.     }
  174.     public function addGeneralSkill(GeneralSkill $generalSkill): self
  175.     {
  176.         if (!$this->generalSkill->contains($generalSkill)) {
  177.             $this->generalSkill[] = $generalSkill;
  178.         }
  179.         return $this;
  180.     }
  181.     public function removeGeneralSkill(GeneralSkill $generalSkill): self
  182.     {
  183.         $this->generalSkill->removeElement($generalSkill);
  184.         return $this;
  185.     }
  186.     /**
  187.      * @return Collection<int, Organism>
  188.      */
  189.     public function getOrganism(): Collection
  190.     {
  191.         return $this->organism;
  192.     }
  193.     public function addOrganism(Organism $organism): self
  194.     {
  195.         if (!$this->organism->contains($organism)) {
  196.             $this->organism[] = $organism;
  197.         }
  198.         return $this;
  199.     }
  200.     public function removeOrganism(Organism $organism): self
  201.     {
  202.         $this->organism->removeElement($organism);
  203.         return $this;
  204.     }
  205.     public function isIsAdmin(): ?bool
  206.     {
  207.         return $this->isAdmin;
  208.     }
  209.     public function setIsAdmin(?bool $isAdmin): self
  210.     {
  211.         $this->isAdmin $isAdmin;
  212.         return $this;
  213.     }
  214.     public function getOrcid(): ?string
  215.     {
  216.         return $this->orcid;
  217.     }
  218.     public function setOrcid(?string $orcid): self
  219.     {
  220.         $this->orcid $orcid;
  221.         return $this;
  222.     }
  223. }