src/Entity/Address.php line 9

Open in your IDE?
  1. <?php
  2. namespace App\Entity;
  3. use App\Repository\AddressRepository;
  4. use Doctrine\ORM\Mapping as ORM;
  5. #[ORM\Entity(repositoryClassAddressRepository::class)]
  6. class Address
  7. {
  8.     #[ORM\Id]
  9.     #[ORM\GeneratedValue]
  10.     #[ORM\Column(type'integer')]
  11.     private $id;
  12.     #[ORM\Column(type'string'length255nullabletrue)]
  13.     private $city;
  14.     #[ORM\Column(type'float'nullabletrue)]
  15.     private $longitude;
  16.     #[ORM\Column(type'float'nullabletrue)]
  17.     private $latitude;
  18.     #[ORM\Column(type'string'length255)]
  19.     private $countryCode;
  20.     
  21.     #[ORM\OneToOne(targetEntityUser::class, mappedBy'address'cascade: ['persist'])]
  22.     private $owner;
  23.     #[ORM\OneToOne(targetEntityCourse::class, mappedBy'address'cascade: ['persist'])]
  24.     private $course;
  25.     #[ORM\Column(type'string'length255)]
  26.     private $fullAddress;
  27.     #[ORM\Column(type'string'length255nullabletrue)]
  28.     private $placeId;
  29.     #[ORM\ManyToOne(targetEntityUser::class, inversedBy'areas')]
  30.     private $pro;
  31.     
  32.     public function getId(): ?int
  33.     {
  34.         return $this->id;
  35.     }
  36.     public function getCity(): ?string
  37.     {
  38.         return $this->city;
  39.     }
  40.     public function setCity(string $city): self
  41.     {
  42.         $this->city $city;
  43.         return $this;
  44.     }
  45.     public function getLongitude(): ?float
  46.     {
  47.         return $this->longitude;
  48.     }
  49.     public function setLongitude(float $longitude): self
  50.     {
  51.         $this->longitude $longitude;
  52.         return $this;
  53.     }
  54.     public function getLatitude(): ?float
  55.     {
  56.         return $this->latitude;
  57.     }
  58.     public function setLatitude(float $latitude): self
  59.     {
  60.         $this->latitude $latitude;
  61.         return $this;
  62.     }
  63.     public function getOwner(): ?User
  64.     {
  65.         return $this->owner;
  66.     }
  67.     public function setOwner(?User $owner): self
  68.     {
  69.         // unset the owning side of the relation if necessary
  70.         if ($owner === null && $this->owner !== null) {
  71.             $this->owner->setAddress(null);
  72.         }
  73.         // set the owning side of the relation if necessary
  74.         if ($owner !== null && $owner->getAddress() !== $this) {
  75.             $owner->setAddress($this);
  76.         }
  77.         $this->owner $owner;
  78.         return $this;
  79.     }
  80.     /**
  81.      * Get the value of fullAddress
  82.      */ 
  83.     public function getFullAddress()
  84.     {
  85.         return $this->fullAddress;
  86.     }
  87.     /**
  88.      * Set the value of fullAddress
  89.      *
  90.      * @return  self
  91.      */ 
  92.     public function setFullAddress($fullAddress)
  93.     {
  94.         $this->fullAddress $fullAddress;
  95.         return $this;
  96.     }
  97.     public function getCourse(): ?Course
  98.     {
  99.         return $this->course;
  100.     }
  101.     public function setCourse(?Course $course): self
  102.     {
  103.         // unset the owning side of the relation if necessary
  104.         if ($course === null && $this->course !== null) {
  105.             $this->course->setAddress(null);
  106.         }
  107.         // set the owning side of the relation if necessary
  108.         if ($course !== null && $course->getAddress() !== $this) {
  109.             $course->setAddress($this);
  110.         }
  111.         $this->course $course;
  112.         return $this;
  113.     }
  114.     public function getCountryCode(): ?string
  115.     {
  116.         return $this->countryCode;
  117.     }
  118.     public function setCountryCode(string $countryCode): self
  119.     {
  120.         $this->countryCode $countryCode;
  121.         return $this;
  122.     }
  123.     public function getPlaceId(): ?string
  124.     {
  125.         return $this->placeId;
  126.     }
  127.     public function setPlaceId(?string $placeId): self
  128.     {
  129.         $this->placeId $placeId;
  130.         return $this;
  131.     }
  132.     public function getPro(): ?User
  133.     {
  134.         return $this->pro;
  135.     }
  136.     public function setPro(?User $pro): self
  137.     {
  138.         $this->pro $pro;
  139.         return $this;
  140.     }
  141. }