mirror of
https://gitlab.com/Chill-Projet/chill-bundles.git
synced 2025-06-07 18:44:08 +00:00
235 lines
3.8 KiB
PHP
235 lines
3.8 KiB
PHP
<?php
|
|
|
|
namespace Chill\MainBundle\Entity;
|
|
|
|
use Chill\MainBundle\Doctrine\Model\Point;
|
|
use Doctrine\ORM\Mapping as ORM;
|
|
use Symfony\Component\Serializer\Annotation\Groups;
|
|
|
|
/**
|
|
* PostalCode
|
|
*
|
|
* @ORM\Entity
|
|
* @ORM\Table(
|
|
* name="chill_main_postal_code",
|
|
* indexes={@ORM\Index(
|
|
* name="search_name_code",
|
|
* columns={"code", "label"}
|
|
* )})
|
|
* @ORM\HasLifecycleCallbacks()
|
|
*
|
|
*/
|
|
class PostalCode
|
|
{
|
|
/**
|
|
* @var integer
|
|
*
|
|
* @ORM\Id
|
|
* @ORM\Column(name="id", type="integer")
|
|
* @ORM\GeneratedValue(strategy="AUTO")
|
|
* @groups({"write", "read"})
|
|
*/
|
|
private $id;
|
|
|
|
/**
|
|
* @var string
|
|
*
|
|
* @ORM\Column(type="string", length=255, name="label")
|
|
* @groups({"write", "read"})
|
|
*/
|
|
private $name;
|
|
|
|
/**
|
|
* @var string
|
|
*
|
|
* @ORM\Column(type="string", length=100)
|
|
* @groups({"write", "read"})
|
|
*/
|
|
private $code;
|
|
|
|
/**
|
|
* @var Country
|
|
*
|
|
* @ORM\ManyToOne(targetEntity="Chill\MainBundle\Entity\Country")
|
|
* @groups({"write", "read"})
|
|
*/
|
|
private $country;
|
|
|
|
/**
|
|
* @var integer
|
|
*
|
|
* @ORM\Column(name="origin", type="integer", nullable=true)
|
|
* @groups({"write", "read"})
|
|
*/
|
|
private $origin = 0;
|
|
|
|
/**
|
|
* @var string
|
|
*
|
|
* @ORM\Column(type="string", length=255, nullable=true)
|
|
* @groups({"write", "read"})
|
|
*/
|
|
private $refId;
|
|
|
|
/**
|
|
* @var string
|
|
*
|
|
* @ORM\Column(type="string", length=255, nullable=true)
|
|
* @groups({"write", "read"})
|
|
*/
|
|
private $source;
|
|
|
|
/**
|
|
* @var Point
|
|
*
|
|
* @ORM\Column(type="point", nullable=true)
|
|
* @groups({"write", "read"})
|
|
*/
|
|
private $center;
|
|
|
|
/**
|
|
* Get id
|
|
*
|
|
* @return integer
|
|
*/
|
|
public function getId()
|
|
{
|
|
return $this->id;
|
|
}
|
|
|
|
|
|
/**
|
|
* Set origin
|
|
*
|
|
* @param int $origin
|
|
*
|
|
* @return PostalCode
|
|
*/
|
|
public function setOrigin($origin)
|
|
{
|
|
$this->origin = $origin;
|
|
|
|
return $this;
|
|
}
|
|
|
|
/**
|
|
* Get origin
|
|
*
|
|
* @return int
|
|
*/
|
|
public function getOrigin()
|
|
{
|
|
return $this->origin;
|
|
}
|
|
|
|
|
|
/**
|
|
* Set name
|
|
*
|
|
* @param string $name
|
|
*
|
|
* @return PostalCode
|
|
*/
|
|
public function setName($name)
|
|
{
|
|
$this->name = $name;
|
|
|
|
return $this;
|
|
}
|
|
|
|
/**
|
|
* Get name
|
|
*
|
|
* @return string
|
|
*/
|
|
public function getName()
|
|
{
|
|
return $this->name;
|
|
}
|
|
|
|
/**
|
|
* Set code
|
|
*
|
|
* @param string $code
|
|
*
|
|
* @return PostalCode
|
|
*/
|
|
public function setCode($code)
|
|
{
|
|
$this->code = $code;
|
|
|
|
return $this;
|
|
}
|
|
|
|
/**
|
|
* Get code
|
|
*
|
|
* @return string
|
|
*/
|
|
public function getCode()
|
|
{
|
|
return $this->code;
|
|
}
|
|
|
|
/**
|
|
* Set country
|
|
*
|
|
* @param Country $country
|
|
*
|
|
* @return PostalCode
|
|
*/
|
|
public function setCountry(Country $country = null)
|
|
{
|
|
$this->country = $country;
|
|
|
|
return $this;
|
|
}
|
|
|
|
/**
|
|
* Get country
|
|
*
|
|
* @return Country
|
|
*/
|
|
public function getCountry()
|
|
{
|
|
return $this->country;
|
|
}
|
|
|
|
public function getRefId(): ?string
|
|
{
|
|
return $this->refId;
|
|
}
|
|
|
|
public function setRefId(?string $refId): self
|
|
{
|
|
$this->refId = $refId;
|
|
|
|
return $this;
|
|
}
|
|
|
|
public function getSource(): ?string
|
|
{
|
|
return $this->source;
|
|
}
|
|
|
|
public function setSource(?string $source): self
|
|
{
|
|
$this->source = $source;
|
|
|
|
return $this;
|
|
}
|
|
|
|
public function getCenter(): ?Point
|
|
{
|
|
return $this->center;
|
|
}
|
|
|
|
public function setCenter(?Point $center): self
|
|
{
|
|
$this->center = $center;
|
|
|
|
return $this;
|
|
}
|
|
}
|
|
|