<?php
namespace Xearts\Bundle\TaobaoDaikoBundle\Entity;
use ApiPlatform\Core\Annotation\ApiProperty;
use Doctrine\ORM\Mapping as ORM;
use Symfony\Component\Serializer\Annotation as Serializer;
use Symfony\Component\Validator\Constraints as Assert;
/**
* Class Address.
*
* @ORM\Embeddable()
*/
class Address
{
/**
* @var string お名前
* @ORM\Column(type = "string", nullable=true)
* @Assert\NotBlank(
* message="address.name.not_blank",
* groups={"MyRegistration", "MyProfile", "MyPage", "AdminEdit"}
* )
* @Assert\Length(
* min=1,
* minMessage="address.name.short",
* max=50,
* maxMessage="address.name.long",
* allowEmptyString="true",
* groups={"MyRegistration", "MyProfile", "MyPage", "AdminEdit"}
* )
* @Serializer\Groups({"api_estimate", "api_estimate_post"})
* @ApiProperty(
* openapiContext={"nullable"="false"},
* example="山田 太郎",
* )
*/
private $name;
/**
* @var string お名前(アルファベット)
* @ORM\Column(type = "string", nullable=true)
* @Assert\NotBlank(
* message="address.name_alphabet.not_blank",
* groups={"MyRegistration", "MyProfile", "MyPage", "AdminEdit"}
* )
* @Assert\Length(
* min=1,
* minMessage="address.name_alphabet.short",
* max=100,
* maxMessage="address.name_alphabet.long",
* allowEmptyString="true",
* groups={"MyRegistration", "MyProfile", "MyPage", "AdminEdit"}
* )
* @Assert\Regex(
* pattern="/^[a-zA-Z\s]+$/",
* message="address.name_alphabet.alphabet",
* groups={"MyRegistration", "MyProfile", "MyPage", "AdminEdit"}
* )
* @Assert\Regex(
* pattern="/^[^\s]+\s[^\s]+$/",
* message="address.name_alphabet.insert_space",
* groups={"MyRegistration", "MyProfile", "MyPage", "AdminEdit"}
* )
* @Serializer\Groups({"api_estimate", "api_estimate_post"})
* @ApiProperty(
* openapiContext={"nullable"="false"},
* example="Taro Yamada",
* )
*/
private $nameAlphabet;
/**
* @var string 郵便番号
* @ORM\Column(type = "string", nullable=true)
* @Assert\NotBlank(
* message="address.zip_code.not_blank",
* groups={"MyRegistration", "MyProfile", "MyPage", "AdminEdit"}
* )
* @Assert\Regex(
* pattern="/^[0-9]{7}$/",
* message="address.zip_code.invalid",
* groups={"MyRegistration", "MyProfile", "MyPage", "AdminEdit"}
* )
* @Serializer\Groups({"api_estimate", "api_estimate_post"})
* @ApiProperty(
* openapiContext={"nullable"="false"},
* example="460-0001",
* )
*/
private $zipCode;
/**
* @var string 市区町村
* @ORM\Column(type = "string", nullable=true)
* @Assert\NotBlank(
* message="address.city.not_blank",
* groups={"MyRegistration", "MyProfile", "MyPage", "AdminEdit"}
* )
* @Assert\Length(
* max=200,
* maxMessage="address.city.long",
* groups={"MyRegistration", "MyProfile", "MyPage", "AdminEdit"}
* )
* @Serializer\Groups({"api_estimate", "api_estimate_post"})
* @ApiProperty(
* openapiContext={"nullable"="false"},
* example="名古屋市中区丸の内",
* )
*/
private $city;
/**
* @var string 番地
* @ORM\Column(type = "string", nullable=true)
* @Assert\Length(
* max=200,
* maxMessage="address.street_name.long",
* groups={"MyRegistration", "MyProfile", "MyPage", "AdminEdit"}
* )
* @Serializer\Groups({"api_estimate", "api_estimate_post"})
* @ApiProperty(
* openapiContext={"nullable"="false"},
* example="1-1",
* )
*/
private $streetName;
/**
* @var string 建物名
* @ORM\Column(type = "string", nullable=true)
* @Assert\Length(
* max=200,
* maxMessage="address.building_name.long",
* groups={"MyRegistration", "MyProfile", "MyPage", "AdminEdit"}
* )
* @Serializer\Groups({"api_estimate", "api_estimate_post"})
* @ApiProperty(
* example="OXビル2F",
* )
*/
private $buildingName;
/**
* @var string 電話番号
* @ORM\Column(type = "string", nullable=true)
* @Assert\NotBlank(
* message="address.tel_number.not_blank",
* groups={"MyRegistration", "MyProfile", "MyPage", "AdminEdit"}
* )
* @Assert\Regex(
* pattern="/^[0-9]{8,15}$/",
* message="address.tel_number.invalid",
* groups={"MyRegistration", "MyProfile", "MyPage", "AdminEdit"}
* )
* @Serializer\Groups({"api_estimate", "api_estimate_post"})
* @ApiProperty(
* openapiContext={"nullable"="false"},
* example="052-111-2222",
* )
*/
private $telNumber;
/**
* @var string
* @ORM\Column(type = "string", nullable=true)
* @Assert\Regex(
* pattern="/^[0-9]{8,15}$/",
* message="address.fax_number.invalid",
* groups={"MyRegistration", "MyProfile"}
* )
*/
private $faxNumber;
/**
* @return string
*/
public function getName()
{
return $this->name;
}
/**
* @param string $name
*
* @return Address
*/
public function setName($name)
{
$this->name = $name;
return $this;
}
/**
* @return string
*/
public function getNameAlphabet()
{
return $this->nameAlphabet;
}
/**
* @param string $nameAlphabet
*
* @return Address
*/
public function setNameAlphabet($nameAlphabet)
{
$this->nameAlphabet = $nameAlphabet;
return $this;
}
/**
* @return string
*/
public function getZipCode()
{
return $this->zipCode;
}
/**
* @param string $zipCode
*
* @return Address
*/
public function setZipCode($zipCode)
{
$this->zipCode = $zipCode;
return $this;
}
/**
* @return string
*/
public function getCity()
{
return $this->city;
}
/**
* @param string $city
*
* @return Address
*/
public function setCity($city)
{
$this->city = $city;
return $this;
}
/**
* @return string
*/
public function getStreetName()
{
return $this->streetName;
}
/**
* @param string $streetName
*
* @return Address
*/
public function setStreetName($streetName)
{
$this->streetName = $streetName;
return $this;
}
/**
* @return string
*/
public function getBuildingName()
{
return $this->buildingName;
}
/**
* @param string $buildingName
*
* @return Address
*/
public function setBuildingName($buildingName)
{
$this->buildingName = $buildingName;
return $this;
}
/**
* @return string
*/
public function getTelNumber()
{
return $this->telNumber;
}
/**
* @param string $telNumber
*
* @return Address
*/
public function setTelNumber($telNumber)
{
$this->telNumber = $telNumber;
return $this;
}
/**
* @return string
*/
public function getFaxNumber()
{
return $this->faxNumber;
}
/**
* @param string $faxNumber
*
* @return Address
*/
public function setFaxNumber($faxNumber)
{
$this->faxNumber = $faxNumber;
return $this;
}
}