<?php
namespace Roothirsch\CoreBundle\Entity;
use ApiPlatform\Core\Annotation\ApiResource;
use Doctrine\ORM\Mapping as ORM;
use Symfony\Component\Serializer\Annotation\Groups;
/**
* @ORM\Entity(repositoryClass="Roothirsch\CoreBundle\Repository\AddressRepository")
* @ORM\Table(name="address")
* @ApiResource
*/
class Address
{
/**
* @ORM\Id
* @ORM\GeneratedValue
* @ORM\Column(type="integer")
* @Groups({"read", "company_read", "write", "company_write", "company_simple"})
*/
private $id;
/**
* @ORM\Column(type="boolean", options={"default"=false})
* @Groups({"read", "company_read", "write", "company_write", "company_simple"})
*/
private $active = true;
/**
* @ORM\Column(type="string", nullable=true)
* @Groups({"read", "company_read", "write", "company_write", "company_simple"})
*/
private $name;
/**
* @ORM\Column(type="string", nullable=true)
* @Groups({"read", "company_read", "write", "company_write", "company_simple"})
*/
private $email;
/**
* @ORM\Column(type="string", nullable=true)
* @Groups({"read", "company_read", "write", "company_write", "company_simple"})
*/
private $street;
/**
* @ORM\Column(type="string", nullable=true)
* @Groups({"read", "company_read", "write", "company_write", "company_simple"})
*/
private $houseNumber;
/**
* @ORM\Column(type="string", nullable=true)
* @Groups({"read", "company_read", "write", "company_write", "company_simple"})
*/
private $zipCode;
/**
* @ORM\Column(type="string", nullable=true)
* @Groups({"read", "company_read", "write", "company_write", "company_simple"})
*/
private $city;
/**
* @ORM\Column(type="string", nullable=true)
* @Groups({"read", "company_read", "write", "company_write", "company_simple"})
*/
private $country;
/**
* @ORM\Column(type="string", nullable=true)
* @Groups({"read", "company_read", "write", "company_write", "company_simple"})
*/
private $phone;
public function __toString()
{
return "$this->street $this->houseNumber, $this->zipCode $this->city";
}
/**
* @return mixed
*/
public function getId()
{
return $this->id;
}
/**
* @param mixed $id
*/
public function setId($id)
{
$this->id = $id;
}
/**
* @return mixed
*/
public function getName()
{
return $this->name;
}
/**
* @param mixed $name
*/
public function setName($name)
{
$this->name = $name;
}
/**
* @return mixed
*/
public function getEmail()
{
return $this->email;
}
/**
* @param mixed $email
*/
public function setEmail($email)
{
$this->email = $email;
}
/**
* @return mixed
*/
public function getStreet()
{
return $this->street;
}
/**
* @param mixed $street
*/
public function setStreet($street)
{
$this->street = $street;
}
/**
* @return mixed
*/
public function getHouseNumber()
{
return $this->houseNumber;
}
/**
* @param mixed $houseNumber
*/
public function setHouseNumber($houseNumber)
{
$this->houseNumber = $houseNumber;
}
/**
* @return mixed
*/
public function getZipCode()
{
return $this->zipCode;
}
/**
* @param mixed $zipCode
*/
public function setZipCode($zipCode)
{
$this->zipCode = $zipCode;
}
/**
* @return mixed
*/
public function getCity()
{
return $this->city;
}
/**
* @param mixed $city
*/
public function setCity($city)
{
$this->city = $city;
}
/**
* @return mixed
*/
public function getPhone()
{
return $this->phone;
}
/**
* @param mixed $phone
*/
public function setPhone($phone)
{
$this->phone = $phone;
}
/**
* @return bool
*/
public function isActive(): bool
{
return $this->active;
}
/**
* @param bool $active
*/
public function setActive(bool $active): void
{
$this->active = $active;
}
/**
* @return mixed
*/
public function getCountry()
{
return $this->country;
}
/**
* @param mixed $country
*/
public function setCountry($country): void
{
$this->country = $country;
}
}