src/Entity/Structures.php

  1. <?php
  2. namespace App\Entity;
  3. use Doctrine\Common\Collections\ArrayCollection;
  4. use Doctrine\Common\Collections\Collection;
  5. use Doctrine\DBAL\Types\Types;
  6. use Doctrine\ORM\Mapping as ORM;
  7. /**
  8.  * @ORM\Entity(repositoryClass="App\Repository\StructuresRepository")
  9.  */
  10. class Structures extends OSEntity
  11. {
  12.     public function __construct(){
  13.         parent::__construct();
  14.         $this->projects = new ArrayCollection();
  15.     }
  16.     /**
  17.      * @var string
  18.      *
  19.      * @ORM\Column(name="position", type="integer", nullable=true)
  20.      */
  21.     private $position;
  22.     /**
  23.      * @var string
  24.      *
  25.      * @ORM\Column(name="abbreviation", type="string", length=255,nullable=true)
  26.      */
  27.     private $abbreviation;
  28.     /**
  29.      * @ORM\OneToOne(targetEntity="App\Entity\Picture", cascade={"persist","remove"}, orphanRemoval=true)
  30.      * @ORM\JoinColumn(nullable=true)
  31.      */
  32.     private $logo;
  33.     /**
  34.      * @var string
  35.      *
  36.      * @ORM\Column(type="string", length=255,nullable=true)
  37.      */
  38.     private $director;
  39.     /**
  40.      * @var string
  41.      *
  42.      * @ORM\Column(type="string", length=255,nullable=true)
  43.      */
  44.     private $directorTitle;
  45.     /**
  46.      * @var string
  47.      *
  48.      * @ORM\Column(type="string", length=255,nullable=true)
  49.      */
  50.     private $directorFacebook;
  51.     /**
  52.      * @var string
  53.      *
  54.      * @ORM\Column(type="string", length=255,nullable=true)
  55.      */
  56.     private $directorTwitter;
  57.     /**
  58.      * @ORM\OneToOne(targetEntity="App\Entity\Picture", cascade={"persist","remove"}, orphanRemoval=true)
  59.      * @ORM\JoinColumn(nullable=true)
  60.      */
  61.     private $directorPicture;
  62.     /**
  63.      * @var string
  64.      *
  65.      * @ORM\Column(type="string", length=255,nullable=true)
  66.      */
  67.     private $address;
  68.     /**
  69.      * @var string
  70.      *
  71.      * @ORM\Column(type="string", length=255,nullable=true)
  72.      */
  73.     private $phone;
  74.     /**
  75.      * @var string
  76.      *
  77.      * @ORM\Column(type="string", length=255,nullable=true)
  78.      */
  79.     private $email;
  80.     /**
  81.      * @var string
  82.      *
  83.      * @ORM\Column(type="string", length=255,nullable=true)
  84.      */
  85.     private $website;
  86.     /**
  87.      * @var string
  88.      *
  89.      * @ORM\Column(type="string", length=255,nullable=true)
  90.      */
  91.     private $map;
  92.     /**
  93.      * @ORM\ManyToOne(targetEntity=StructuresCategories::class, inversedBy="structures", fetch="EAGER")
  94.      * @ORM\JoinColumn(nullable=true)
  95.      */
  96.     private $category;
  97.     /**
  98.      * @ORM\Column(type="string", length=255, nullable=true)
  99.      */
  100.     private $town;
  101.     /**
  102.      * @ORM\Column(type="string", length=255, nullable=true)
  103.      */
  104.     private $longitude;
  105.     /**
  106.      * @ORM\Column(type="string", length=255, nullable=true)
  107.      */
  108.     private $latitude;
  109.     /**
  110.      * @ORM\Column(type="boolean", nullable=true)
  111.      */
  112.     private $isOnTop;
  113.     public function getName(): ?string
  114.     {
  115.         return $this->getTitle();
  116.     }
  117.     public function setName(?string $name): self
  118.     {
  119.         return $this->setTitle();
  120.     }
  121.     public function getPosition(): ?int
  122.     {
  123.         return $this->position;
  124.     }
  125.     public function setPosition(?int $position): self
  126.     {
  127.         $this->position $position;
  128.         return $this;
  129.     }
  130.     public function getAbbreviation(): ?string
  131.     {
  132.         return $this->abbreviation;
  133.     }
  134.     public function setAbbreviation(?string $abbreviation): self
  135.     {
  136.         $this->abbreviation $abbreviation;
  137.         return $this;
  138.     }
  139.     public function getDirector(): ?string
  140.     {
  141.         return $this->director;
  142.     }
  143.     public function setDirector(?string $director): self
  144.     {
  145.         $this->director $director;
  146.         return $this;
  147.     }
  148.     public function getDirectorPicture(): ?Picture
  149.     {
  150.         return $this->directorPicture;
  151.     }
  152.     public function setDirectorPicture(?Picture $directorPicture): self
  153.     {
  154.         if($directorPicture->getTarget()){
  155.             $this->directorPicture $directorPicture;
  156.             $this->directorPicture->setDir('upload/images/structures');
  157.             $this->directorPicture->setThumbnailDir('upload/thumbnails/structures');
  158.         }
  159.         return $this;
  160.     }
  161.     public function getAddress(): ?string
  162.     {
  163.         return $this->address;
  164.     }
  165.     public function setAddress(?string $address): self
  166.     {
  167.         $this->address $address;
  168.         return $this;
  169.     }
  170.     public function getPhone(): ?string
  171.     {
  172.         return $this->phone;
  173.     }
  174.     public function setPhone(?string $phone): self
  175.     {
  176.         $this->phone $phone;
  177.         return $this;
  178.     }
  179.     public function getEmail(): ?string
  180.     {
  181.         return $this->email;
  182.     }
  183.     public function setEmail(?string $email): self
  184.     {
  185.         $this->email $email;
  186.         return $this;
  187.     }
  188.     public function getWebsite(): ?string
  189.     {
  190.         return $this->website;
  191.     }
  192.     public function setWebsite(?string $website): self
  193.     {
  194.         $this->website $website;
  195.         return $this;
  196.     }
  197.     public function getMap(): ?string
  198.     {
  199.         return $this->map;
  200.     }
  201.     public function setMap(?string $map): self
  202.     {
  203.         $this->map $map;
  204.         return $this;
  205.     }
  206.     public function getLogo(): ?Picture
  207.     {
  208.         return $this->logo;
  209.     }
  210.     public function setLogo(?Picture $logo): self
  211.     {
  212.         if($logo->getTarget()){
  213.             $this->logo $logo;
  214.             $this->logo->setDir('upload/images/structures');
  215.             $this->logo->setThumbnailDir('upload/thumbnails/structures');
  216.         }
  217.         return $this;
  218.     }
  219.     public function getCategory(): ?StructuresCategories
  220.     {
  221.         return $this->category;
  222.     }
  223.     public function setCategory(?StructuresCategories $category): self
  224.     {
  225.         $this->category $category;
  226.         return $this;
  227.     }
  228.     public function getTown(): ?string
  229.     {
  230.         return $this->town;
  231.     }
  232.     public function setTown(?string $town): self
  233.     {
  234.         $this->town $town;
  235.         return $this;
  236.     }
  237.     public function getLongitude(): ?string
  238.     {
  239.         return $this->longitude;
  240.     }
  241.     public function setLongitude(?string $longitude): self
  242.     {
  243.         $this->longitude $longitude;
  244.         return $this;
  245.     }
  246.     public function getLatitude(): ?string
  247.     {
  248.         return $this->latitude;
  249.     }
  250.     public function setLatitude(?string $latitude): self
  251.     {
  252.         $this->latitude $latitude;
  253.         return $this;
  254.     }
  255.     public function getIsOnTop(): ?bool
  256.     {
  257.         return $this->isOnTop;
  258.     }
  259.     public function setIsOnTop(?bool $isOnTop): self
  260.     {
  261.         $this->isOnTop $isOnTop;
  262.         return $this;
  263.     }
  264.     public function getDirectorTitle(): ?string
  265.     {
  266.         return $this->directorTitle;
  267.     }
  268.     public function setDirectorTitle(?string $directorTitle): self
  269.     {
  270.         $this->directorTitle $directorTitle;
  271.         return $this;
  272.     }
  273.     public function getDirectorFacebook(): ?string
  274.     {
  275.         return $this->directorFacebook;
  276.     }
  277.     public function setDirectorFacebook(?string $directorFacebook): self
  278.     {
  279.         $this->directorFacebook $directorFacebook;
  280.         return $this;
  281.     }
  282.     public function getDirectorTwitter(): ?string
  283.     {
  284.         return $this->directorTwitter;
  285.     }
  286.     public function setDirectorTwitter(?string $directorTwitter): self
  287.     {
  288.         $this->directorTwitter $directorTwitter;
  289.         return $this;
  290.     }
  291.     public function isIsOnTop(): ?bool
  292.     {
  293.         return $this->isOnTop;
  294.     }
  295. }