src/Entity/Common/Address.php line 12

Open in your IDE?
  1. <?php
  2. namespace App\Entity\Common;
  3. use Doctrine\ORM\Mapping as ORM;
  4. use Nellapp\Bundle\SDKBundle\Entity\Common\Address\AddressMethodTrait;
  5. use Symfony\Component\Validator\Constraints as Assert;
  6. use Symfony\Component\Serializer\Annotation as Serial;
  7. use Nellapp\Bundle\SDKBundle\Entity\Common\Address\Address as BaseAddress;
  8. #[ORM\Embeddable]
  9. class Address extends BaseAddress
  10. {
  11.     use AddressMethodTrait;
  12.     #[ORM\Column(type'string'nullabletrue)]
  13.     #[Assert\Length(min3max255minMessage'common.address.street.Length.min'maxMessage'common.address.street.Length.max'groups: ['Default''flow_channel_user_create_step2''admin_learner_profile''admin_admin_profile'])]
  14.     #[Serial\Groups(['Sync'])]
  15.     private ?string $street null;
  16.     #[ORM\Column(type'string'length15nullabletrue)]
  17.     #[
  18.         Assert\Length(min4max15minMessage'common.address.postCode.Length.min'maxMessage'common.address.postCode.Length.max'groups: ['Default''flow_channel_user_create_step2''admin_learner_profile''admin_admin_profile']),
  19.         Assert\Regex(pattern'/^\d{4,15}$/'message'common.address.postCode.Regex'groups: ['user_edition''flow_channel_user_create_step2''admin_learner_profile''admin_admin_profile']),
  20.     ]
  21.     #[Serial\Groups(['Sync'])]
  22.     private ?string $postCode null;
  23.     #[ORM\Column(type'string'nullabletrue)]
  24.     #[Assert\Length(min2max255minMessage'common.address.city.Length.min'maxMessage'common.address.city.Length.max'groups: ['Default''flow_channel_user_create_step2''admin_learner_profile''admin_admin_profile'])]
  25.     #[Serial\Groups(['Sync'])]
  26.     private ?string $city null;
  27.     #[ORM\Column(type'string'length2nullabletrue)]
  28.     #[
  29.         Assert\Length(min2max2exactMessage'common.address.country.Length.exact'groups: ['Default''flow_channel_user_create_step2''admin_learner_profile''admin_admin_profile']),
  30.         Assert\Country(message'common.address.country.Country'groups: ['Default''flow_channel_user_create_step2''admin_learner_profile''admin_admin_profile']),
  31.     ]
  32.     #[Serial\Groups(['Sync'])]
  33.     private ?string $country null;
  34. }