vendor/xearts/taobao-daiko-bundle/src/Entity/Address.php line 15

Open in your IDE?
  1. <?php
  2. namespace Xearts\Bundle\TaobaoDaikoBundle\Entity;
  3. use ApiPlatform\Core\Annotation\ApiProperty;
  4. use Doctrine\ORM\Mapping as ORM;
  5. use Symfony\Component\Serializer\Annotation as Serializer;
  6. use Symfony\Component\Validator\Constraints as Assert;
  7. /**
  8.  * Class Address.
  9.  *
  10.  * @ORM\Embeddable()
  11.  */
  12. class Address
  13. {
  14.     /**
  15.      * @var string お名前
  16.      * @ORM\Column(type = "string", nullable=true)
  17.      * @Assert\NotBlank(
  18.      *  message="address.name.not_blank",
  19.      *  groups={"MyRegistration", "MyProfile", "MyPage", "AdminEdit"}
  20.      * )
  21.      * @Assert\Length(
  22.      *  min=1,
  23.      *  minMessage="address.name.short",
  24.      *  max=50,
  25.      *  maxMessage="address.name.long",
  26.      *  allowEmptyString="true",
  27.      *  groups={"MyRegistration", "MyProfile", "MyPage", "AdminEdit"}
  28.      * )
  29.      * @Serializer\Groups({"api_estimate", "api_estimate_post"})
  30.      * @ApiProperty(
  31.      *     openapiContext={"nullable"="false"},
  32.      *     example="山田 太郎",
  33.      * )
  34.      */
  35.     private $name;
  36.     /**
  37.      * @var string お名前(アルファベット)
  38.      * @ORM\Column(type = "string", nullable=true)
  39.      * @Assert\NotBlank(
  40.      *  message="address.name_alphabet.not_blank",
  41.      *  groups={"MyRegistration", "MyProfile", "MyPage", "AdminEdit"}
  42.      * )
  43.      * @Assert\Length(
  44.      *  min=1,
  45.      *  minMessage="address.name_alphabet.short",
  46.      *  max=100,
  47.      *  maxMessage="address.name_alphabet.long",
  48.      *  allowEmptyString="true",
  49.      *  groups={"MyRegistration", "MyProfile", "MyPage", "AdminEdit"}
  50.      * )
  51.      * @Assert\Regex(
  52.      *  pattern="/^[a-zA-Z\s]+$/",
  53.      *  message="address.name_alphabet.alphabet",
  54.      *  groups={"MyRegistration", "MyProfile", "MyPage", "AdminEdit"}
  55.      * )
  56.      * @Assert\Regex(
  57.      *  pattern="/^[^\s]+\s[^\s]+$/",
  58.      *  message="address.name_alphabet.insert_space",
  59.      *  groups={"MyRegistration", "MyProfile", "MyPage", "AdminEdit"}
  60.      * )
  61.      * @Serializer\Groups({"api_estimate", "api_estimate_post"})
  62.      * @ApiProperty(
  63.      *     openapiContext={"nullable"="false"},
  64.      *     example="Taro Yamada",
  65.      * )
  66.      */
  67.     private $nameAlphabet;
  68.     /**
  69.      * @var string 郵便番号
  70.      * @ORM\Column(type = "string", nullable=true)
  71.      * @Assert\NotBlank(
  72.      *  message="address.zip_code.not_blank",
  73.      *  groups={"MyRegistration", "MyProfile", "MyPage", "AdminEdit"}
  74.      * )
  75.      * @Assert\Regex(
  76.      *  pattern="/^[0-9]{7}$/",
  77.      *  message="address.zip_code.invalid",
  78.      *  groups={"MyRegistration", "MyProfile", "MyPage", "AdminEdit"}
  79.      * )
  80.      * @Serializer\Groups({"api_estimate", "api_estimate_post"})
  81.      * @ApiProperty(
  82.      *     openapiContext={"nullable"="false"},
  83.      *     example="460-0001",
  84.      * )
  85.      */
  86.     private $zipCode;
  87.     /**
  88.      * @var string 市区町村
  89.      * @ORM\Column(type = "string", nullable=true)
  90.      * @Assert\NotBlank(
  91.      *  message="address.city.not_blank",
  92.      *  groups={"MyRegistration", "MyProfile", "MyPage", "AdminEdit"}
  93.      * )
  94.      * @Assert\Length(
  95.      *  max=200,
  96.      *  maxMessage="address.city.long",
  97.      *  groups={"MyRegistration", "MyProfile", "MyPage", "AdminEdit"}
  98.      * )
  99.      * @Serializer\Groups({"api_estimate", "api_estimate_post"})
  100.      * @ApiProperty(
  101.      *     openapiContext={"nullable"="false"},
  102.      *     example="名古屋市中区丸の内",
  103.      * )
  104.      */
  105.     private $city;
  106.     /**
  107.      * @var string 番地
  108.      * @ORM\Column(type = "string", nullable=true)
  109.      * @Assert\Length(
  110.      *  max=200,
  111.      *  maxMessage="address.street_name.long",
  112.      *  groups={"MyRegistration", "MyProfile", "MyPage", "AdminEdit"}
  113.      * )
  114.      * @Serializer\Groups({"api_estimate", "api_estimate_post"})
  115.      * @ApiProperty(
  116.      *     openapiContext={"nullable"="false"},
  117.      *     example="1-1",
  118.      * )
  119.      */
  120.     private $streetName;
  121.     /**
  122.      * @var string 建物名
  123.      * @ORM\Column(type = "string", nullable=true)
  124.      * @Assert\Length(
  125.      *  max=200,
  126.      *  maxMessage="address.building_name.long",
  127.      *  groups={"MyRegistration", "MyProfile", "MyPage", "AdminEdit"}
  128.      * )
  129.      * @Serializer\Groups({"api_estimate", "api_estimate_post"})
  130.      * @ApiProperty(
  131.      *     example="OXビル2F",
  132.      * )
  133.      */
  134.     private $buildingName;
  135.     /**
  136.      * @var string 電話番号
  137.      * @ORM\Column(type = "string", nullable=true)
  138.      * @Assert\NotBlank(
  139.      *  message="address.tel_number.not_blank",
  140.      *  groups={"MyRegistration", "MyProfile", "MyPage", "AdminEdit"}
  141.      * )
  142.      * @Assert\Regex(
  143.      *  pattern="/^[0-9]{8,15}$/",
  144.      *  message="address.tel_number.invalid",
  145.      *  groups={"MyRegistration", "MyProfile", "MyPage", "AdminEdit"}
  146.      * )
  147.      * @Serializer\Groups({"api_estimate", "api_estimate_post"})
  148.      * @ApiProperty(
  149.      *     openapiContext={"nullable"="false"},
  150.      *     example="052-111-2222",
  151.      * )
  152.      */
  153.     private $telNumber;
  154.     /**
  155.      * @var string
  156.      * @ORM\Column(type = "string", nullable=true)
  157.      * @Assert\Regex(
  158.      *  pattern="/^[0-9]{8,15}$/",
  159.      *  message="address.fax_number.invalid",
  160.      *  groups={"MyRegistration", "MyProfile"}
  161.      * )
  162.      */
  163.     private $faxNumber;
  164.     /**
  165.      * @return string
  166.      */
  167.     public function getName()
  168.     {
  169.         return $this->name;
  170.     }
  171.     /**
  172.      * @param string $name
  173.      *
  174.      * @return Address
  175.      */
  176.     public function setName($name)
  177.     {
  178.         $this->name $name;
  179.         return $this;
  180.     }
  181.     /**
  182.      * @return string
  183.      */
  184.     public function getNameAlphabet()
  185.     {
  186.         return $this->nameAlphabet;
  187.     }
  188.     /**
  189.      * @param string $nameAlphabet
  190.      *
  191.      * @return Address
  192.      */
  193.     public function setNameAlphabet($nameAlphabet)
  194.     {
  195.         $this->nameAlphabet $nameAlphabet;
  196.         return $this;
  197.     }
  198.     /**
  199.      * @return string
  200.      */
  201.     public function getZipCode()
  202.     {
  203.         return $this->zipCode;
  204.     }
  205.     /**
  206.      * @param string $zipCode
  207.      *
  208.      * @return Address
  209.      */
  210.     public function setZipCode($zipCode)
  211.     {
  212.         $this->zipCode $zipCode;
  213.         return $this;
  214.     }
  215.     /**
  216.      * @return string
  217.      */
  218.     public function getCity()
  219.     {
  220.         return $this->city;
  221.     }
  222.     /**
  223.      * @param string $city
  224.      *
  225.      * @return Address
  226.      */
  227.     public function setCity($city)
  228.     {
  229.         $this->city $city;
  230.         return $this;
  231.     }
  232.     /**
  233.      * @return string
  234.      */
  235.     public function getStreetName()
  236.     {
  237.         return $this->streetName;
  238.     }
  239.     /**
  240.      * @param string $streetName
  241.      *
  242.      * @return Address
  243.      */
  244.     public function setStreetName($streetName)
  245.     {
  246.         $this->streetName $streetName;
  247.         return $this;
  248.     }
  249.     /**
  250.      * @return string
  251.      */
  252.     public function getBuildingName()
  253.     {
  254.         return $this->buildingName;
  255.     }
  256.     /**
  257.      * @param string $buildingName
  258.      *
  259.      * @return Address
  260.      */
  261.     public function setBuildingName($buildingName)
  262.     {
  263.         $this->buildingName $buildingName;
  264.         return $this;
  265.     }
  266.     /**
  267.      * @return string
  268.      */
  269.     public function getTelNumber()
  270.     {
  271.         return $this->telNumber;
  272.     }
  273.     /**
  274.      * @param string $telNumber
  275.      *
  276.      * @return Address
  277.      */
  278.     public function setTelNumber($telNumber)
  279.     {
  280.         $this->telNumber $telNumber;
  281.         return $this;
  282.     }
  283.     /**
  284.      * @return string
  285.      */
  286.     public function getFaxNumber()
  287.     {
  288.         return $this->faxNumber;
  289.     }
  290.     /**
  291.      * @param string $faxNumber
  292.      *
  293.      * @return Address
  294.      */
  295.     public function setFaxNumber($faxNumber)
  296.     {
  297.         $this->faxNumber $faxNumber;
  298.         return $this;
  299.     }
  300. }