<?php
namespace App\Entity;
use App\Repository\AddressRepository;
use Doctrine\ORM\Mapping as ORM;
#[ORM\Entity(repositoryClass: AddressRepository::class)]
class Address
{
#[ORM\Id]
#[ORM\GeneratedValue]
#[ORM\Column(type: 'integer')]
private $id;
#[ORM\Column(type: 'string', length: 255, nullable: true)]
private $city;
#[ORM\Column(type: 'float', nullable: true)]
private $longitude;
#[ORM\Column(type: 'float', nullable: true)]
private $latitude;
#[ORM\Column(type: 'string', length: 255)]
private $countryCode;
#[ORM\OneToOne(targetEntity: User::class, mappedBy: 'address', cascade: ['persist'])]
private $owner;
#[ORM\OneToOne(targetEntity: Course::class, mappedBy: 'address', cascade: ['persist'])]
private $course;
#[ORM\Column(type: 'string', length: 255)]
private $fullAddress;
#[ORM\Column(type: 'string', length: 255, nullable: true)]
private $placeId;
#[ORM\ManyToOne(targetEntity: User::class, inversedBy: 'areas')]
private $pro;
public function getId(): ?int
{
return $this->id;
}
public function getCity(): ?string
{
return $this->city;
}
public function setCity(string $city): self
{
$this->city = $city;
return $this;
}
public function getLongitude(): ?float
{
return $this->longitude;
}
public function setLongitude(float $longitude): self
{
$this->longitude = $longitude;
return $this;
}
public function getLatitude(): ?float
{
return $this->latitude;
}
public function setLatitude(float $latitude): self
{
$this->latitude = $latitude;
return $this;
}
public function getOwner(): ?User
{
return $this->owner;
}
public function setOwner(?User $owner): self
{
// unset the owning side of the relation if necessary
if ($owner === null && $this->owner !== null) {
$this->owner->setAddress(null);
}
// set the owning side of the relation if necessary
if ($owner !== null && $owner->getAddress() !== $this) {
$owner->setAddress($this);
}
$this->owner = $owner;
return $this;
}
/**
* Get the value of fullAddress
*/
public function getFullAddress()
{
return $this->fullAddress;
}
/**
* Set the value of fullAddress
*
* @return self
*/
public function setFullAddress($fullAddress)
{
$this->fullAddress = $fullAddress;
return $this;
}
public function getCourse(): ?Course
{
return $this->course;
}
public function setCourse(?Course $course): self
{
// unset the owning side of the relation if necessary
if ($course === null && $this->course !== null) {
$this->course->setAddress(null);
}
// set the owning side of the relation if necessary
if ($course !== null && $course->getAddress() !== $this) {
$course->setAddress($this);
}
$this->course = $course;
return $this;
}
public function getCountryCode(): ?string
{
return $this->countryCode;
}
public function setCountryCode(string $countryCode): self
{
$this->countryCode = $countryCode;
return $this;
}
public function getPlaceId(): ?string
{
return $this->placeId;
}
public function setPlaceId(?string $placeId): self
{
$this->placeId = $placeId;
return $this;
}
public function getPro(): ?User
{
return $this->pro;
}
public function setPro(?User $pro): self
{
$this->pro = $pro;
return $this;
}
}