| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198 |
- <?php
- namespace AppBundle\Entity\Core;
- use Doctrine\ORM\Mapping as ORM;
- use Dunglas\ApiBundle\Annotation\Iri;
- use Symfony\Component\Serializer\Annotation\Groups;
- use Symfony\Component\Validator\Constraints as Assert;
- /**
- * A city or town.
- * Enum des villes existantes (en France, Suisse, Luxembourg, Belgique)
- *
- *
- * @Iri("http://schema.org/City")
- */
- #[ORM\Entity]
- class City
- {
- /**
- * @var int
- */
- #[ORM\Column(type: 'integer')]
- #[ORM\Id]
- #[ORM\GeneratedValue(strategy: 'AUTO')]
- #[Groups(['city'])]
- private $id;
- /**
- * @var string The name of the item.
- *
- * @Iri("https://schema.org/name")
- */
- #[ORM\Column(type: 'string')]
- #[Assert\Type(type: 'string')]
- #[Assert\NotNull]
- #[Groups(['city'])]
- private $name;
- /**
- * @var Department
- */
- #[ORM\ManyToOne(targetEntity: 'Department')]
- #[ORM\JoinColumn(nullable: false)]
- #[Groups(['city'])]
- private $department;
- /**
- * @var float
- */
- #[ORM\Column(type: 'float', nullable: true)]
- #[Assert\Type(type: 'float')]
- #[Groups(['city'])]
- private $latitude;
- /**
- * @var float
- */
- #[ORM\Column(type: 'float', nullable: true)]
- #[Assert\Type(type: 'float')]
- #[Groups(['city'])]
- private $longitude;
- /**
- * @var string
- */
- #[ORM\Column(type: 'string', length: 20, nullable: true)]
- #[Assert\Type(type: 'string')]
- #[Groups(['city'])]
- private $postalCode;
- /**
- * Sets id.
- *
- * @param int $id
- *
- * @return $this
- */
- public function setId($id)
- {
- $this->id = $id;
- return $this;
- }
- /**
- * Gets id.
- *
- * @return int
- */
- public function getId()
- {
- return $this->id;
- }
- /**
- * Sets name.
- *
- * @param string $name
- *
- * @return $this
- */
- public function setName($name)
- {
- $this->name = $name;
- return $this;
- }
- /**
- * Gets name.
- *
- * @return string
- */
- public function getName()
- {
- return $this->name;
- }
- /**
- * Sets department.
- *
- * @param Department $department
- *
- * @return $this
- */
- public function setDepartment(Department $department = null)
- {
- $this->department = $department;
- return $this;
- }
- /**
- * Gets department.
- *
- * @return Department
- */
- public function getDepartment()
- {
- return $this->department;
- }
- /**
- * Sets latitude.
- *
- * @param float $latitude
- *
- * @return $this
- */
- public function setLatitude($latitude)
- {
- $this->latitude = floatval($latitude);
- return $this;
- }
- /**
- * Gets latitude.
- *
- * @return float
- */
- public function getLatitude()
- {
- return $this->latitude;
- }
- /**
- * Sets longitude.
- *
- * @param float $longitude
- *
- * @return $this
- */
- public function setLongitude($longitude)
- {
- $this->longitude = floatval($longitude);
- return $this;
- }
- /**
- * Gets longitude.
- *
- * @return float
- */
- public function getLongitude()
- {
- return $this->longitude;
- }
- /**
- * Sets postalCode.
- *
- * @param string $postalCode
- *
- * @return $this
- */
- public function setPostalCode($postalCode)
- {
- $this->postalCode = $postalCode;
- return $this;
- }
- /**
- * Gets postalCode.
- *
- * @return string
- */
- public function getPostalCode()
- {
- return $this->postalCode;
- }
- }
|