src/Entity/Town.php line 18

Open in your IDE?
  1. <?php
  2. namespace App\Entity;
  3. use Symfony\Component\Validator\Constraints as Assert;
  4. use Doctrine\Common\Collections\ArrayCollection;
  5. use Doctrine\ORM\Mapping as ORM;
  6. use Symfony\Bridge\Doctrine\Validator\Constraints\UniqueEntity;
  7. use Serializable;
  8. use Doctrine\Common\Collections\Collection;
  9. use Symfony\Component\Serializer\Annotation\Groups;
  10. #[ORM\Entity(repositoryClass:'App\Repository\TownRepository')]
  11. #[ORM\Table(name'town')]
  12. class Town extends User
  13. {
  14.     #[Groups(['town'])]
  15.     #[ORM\Column(name'id'type'integer'uniquetrue)]
  16.     #[ORM\Id]
  17.     #[ORM\GeneratedValue(strategy'AUTO')]
  18.     protected $id;
  19.     #[Groups(['town'])]
  20.     #[ORM\Column(name'name'type'string',length255uniquetrue)]
  21.     protected $name;
  22.     #[Groups(['town'])]
  23.     #[ORM\Column(name'description'type'text')]
  24.     protected $description;
  25.     #[Groups(['town'])]
  26.     #[ORM\Column(name'street'type'string'length255)]
  27.     protected $street;
  28.     #[Groups(['town'])]
  29.     #[ORM\Column(name'streetnumber'type'string'nullabletrue)]
  30.     protected $streetnumber;
  31.     #[Groups(['town'])]
  32.     #[ORM\Column(name'postcode'type'string')]
  33.     protected $postcode;
  34.     #[Groups(['town'])]
  35.     #[ORM\Column(name'city'type'string'length255)]
  36.     protected $city;
  37.     #[Groups(['town'])]
  38.     #[ORM\Column(name'region'type'string'length255)]
  39.     protected $region;
  40.     #[Groups(['town'])]
  41.     #[ORM\Column(name'country'type'string'length255)]
  42.     protected $country;
  43.     #[Groups(['town'])]
  44.     #[ORM\Column(name'phone'type'string'length255)]
  45.     protected $phone;
  46.     #[Groups(['town'])]
  47.     #[ORM\Column(name'vision'type'text')]
  48.     protected $vision;
  49.     #[Groups(['town'])]
  50.     #[ORM\Column(name'urlwebsite'type'string'length255nullabletrue)]
  51.     protected $urlwebsite;
  52.     #[Groups(['town'])]
  53.     #[ORM\Column(name'slug'type'string'length255)]
  54.     protected $slug;
  55.     /**
  56.      * @return int
  57.      */
  58.     public function getId()
  59.     {
  60.         return $this->id;
  61.     }
  62.     /**
  63.      * @param int $id
  64.      */
  65.     public function setId($id)
  66.     {
  67.         $this->id $id;
  68.     }
  69.     /**
  70.      * @return string
  71.      */
  72.     public function getName()
  73.     {
  74.         return $this->name;
  75.     }
  76.     /**
  77.      * @param string $name
  78.      */
  79.     public function setName($name)
  80.     {
  81.         $this->name $name;
  82.     }
  83.     /**
  84.      * @return text
  85.      */
  86.     public function getDescription()
  87.     {
  88.         return $this->description;
  89.     }
  90.     /**
  91.      * @param text $description
  92.      */
  93.     public function setDescription($description)
  94.     {
  95.         $this->description $description;
  96.     }
  97.     /**
  98.      * @return string
  99.      */
  100.     public function getSlug()
  101.     {
  102.         return $this->slug;
  103.     }
  104.     /**
  105.      * @param string $slug
  106.      */
  107.     public function setSlug($slug)
  108.     {
  109.         $this->slug $slug;
  110.     }
  111.     /**
  112.      * @return string
  113.      */
  114.     public function getUrlwebsite()
  115.     {
  116.         return $this->urlwebsite;
  117.     }
  118.     /**
  119.      * @param string $urlwebsite
  120.      */
  121.     public function setUrlwebsite($urlwebsite)
  122.     {
  123.         $this->urlwebsite $urlwebsite;
  124.     }
  125.     /**
  126.      * @return text
  127.      */
  128.     public function getVision()
  129.     {
  130.         return $this->vision;
  131.     }
  132.     /**
  133.      * @param text $vision
  134.      */
  135.     public function setVision($vision)
  136.     {
  137.         $this->vision $vision;
  138.     }
  139.     /**
  140.      * @return string
  141.      */
  142.     public function getStreet(): string
  143.     {
  144.         return $this->street;
  145.     }
  146.     /**
  147.      * @param string $street
  148.      */
  149.     public function setStreet(string $street): void
  150.     {
  151.         $this->street $street;
  152.     }
  153.     /**
  154.      * @return string
  155.      */
  156.     public function getStreetnumber(): string
  157.     {
  158.         return $this->streetnumber;
  159.     }
  160.     /**
  161.      * @param string $streetnumber
  162.      */
  163.     public function setStreetnumber(string $streetnumber): void
  164.     {
  165.         $this->streetnumber $streetnumber;
  166.     }
  167.     /**
  168.      * @return smallint
  169.      */
  170.     public function getPostcode()
  171.     {
  172.         return $this->postcode;
  173.     }
  174.     /**
  175.      * @param smallint $postcode
  176.      */
  177.     public function setPostcode($postcode)
  178.     {
  179.         $this->postcode $postcode;
  180.     }
  181.     /**
  182.      * @return string
  183.      */
  184.     public function getCity(): string
  185.     {
  186.         return $this->city;
  187.     }
  188.     /**
  189.      * @param string $city
  190.      */
  191.     public function setCity(string $city): void
  192.     {
  193.         $this->city $city;
  194.     }
  195.     /**
  196.      * @return string
  197.      */
  198.     public function getRegion()
  199.     {
  200.         return $this->region;
  201.     }
  202.     /**
  203.      * @param string $region
  204.      */
  205.     public function setRegion($region)
  206.     {
  207.         $this->region $region;
  208.     }
  209.     /**
  210.      * @return string
  211.      */
  212.     public function getCountry()
  213.     {
  214.         return $this->country;
  215.     }
  216.     /**
  217.      * @param string $country
  218.      */
  219.     public function setCountry($country)
  220.     {
  221.         $this->country $country;
  222.     }
  223.     /**
  224.      * @return string
  225.      */
  226.     public function getPhone()
  227.     {
  228.         return $this->phone;
  229.     }
  230.     /**
  231.      * @param string $phone
  232.      */
  233.     public function setPhone($phone)
  234.     {
  235.         $this->phone $phone;
  236.     }
  237.     /**
  238.      * @return bool
  239.      */
  240.     public function isActived()
  241.     {
  242.         return $this->actived;
  243.     }
  244.     /**
  245.      * @param bool $actived
  246.      */
  247.     public function setActived($actived)
  248.     {
  249.         $this->actived $actived;
  250.     }
  251.     #[ORM\Column(type'float')]
  252.     private $latitude;
  253.     #[ORM\Column(type'float')]
  254.     private $longtitude;
  255.     #[ORM\ManyToMany(targetEntity'TownFav'mappedBy'town')]
  256.     #[ORM\Column(type'boolean')]
  257.     private $activated false;
  258.     public function getLatitude(): ?float
  259.     {
  260.         return $this->latitude;
  261.     }
  262.     public function setLatitude(float $latitude): self
  263.     {
  264.         $this->latitude $latitude;
  265.         return $this;
  266.     }
  267.     public function getLongtitude(): ?float
  268.     {
  269.         return $this->longtitude;
  270.     }
  271.     public function setLongtitude(float $longtitude): self
  272.     {
  273.         $this->longtitude $longtitude;
  274.         return $this;
  275.     }
  276.     public function getActivated(): ?bool
  277.     {
  278.         return $this->activated;
  279.     }
  280.     public function setActivated(bool $activated): self
  281.     {
  282.         $this->activated $activated;
  283.         return $this;
  284.     }
  285. }