diff --git a/src/Bidcoz/Bundle/CoreBundle/Entity/Address.php b/src/Bidcoz/Bundle/CoreBundle/Entity/Address.php index c55493a..95d56ba 100644 --- a/src/Bidcoz/Bundle/CoreBundle/Entity/Address.php +++ b/src/Bidcoz/Bundle/CoreBundle/Entity/Address.php @@ -2,45 +2,50 @@ namespace Bidcoz\Bundle\CoreBundle\Entity; -use Doctrine\ORM\Mapping as ORM; +use JMS\Serializer\Annotation as Serialize; use Symfony\Component\Validator\Constraints as Assert; /** * A Value object for an address. * - * @ORM\Embeddable + * @Serialize\ExclusionPolicy("all") */ class Address { /** - * @ORM\Column(type="string", length=255, nullable=true) * @Assert\NotBlank(groups={"Profile"}) * @Assert\Length(max=255, groups={"Profile"}) + * @Serialize\Expose + * @Serialize\SerializedName("address1") */ protected $address1; /** - * @ORM\Column(type="string", length=255, nullable=true) + * @Serialize\Expose + * @Serialize\SerializedName("address2") */ protected $address2; /** - * @ORM\Column(type="string", length=128, nullable=true) * @Assert\NotBlank(groups={"Profile"}) * @Assert\Length(max=128, groups={"Profile"}) + * @Serialize\Expose + * @Serialize\SerializedName("city") */ protected $city; /** - * @ORM\Column(type="string", length=2, nullable=true) * @Assert\NotBlank(groups={"Profile"}) + * @Serialize\Expose + * @Serialize\SerializedName("state") */ protected $state; /** - * @ORM\Column(type="string", length=5, nullable=true) * @Assert\NotBlank(groups={"Profile"}) * @Assert\Regex(pattern="/\d{5}/", groups={"Profile"}) + * @Serialize\Expose + * @Serialize\SerializedName("zip") */ protected $zip; diff --git a/src/Bidcoz/Bundle/CoreBundle/Entity/User.php b/src/Bidcoz/Bundle/CoreBundle/Entity/User.php index 833e1e4..6492721 100644 --- a/src/Bidcoz/Bundle/CoreBundle/Entity/User.php +++ b/src/Bidcoz/Bundle/CoreBundle/Entity/User.php @@ -34,6 +34,8 @@ class User /** * @Assert\Valid + * @Serialize\Expose + * @Serialize\SerializedName("address") */ protected $address; diff --git a/src/Bidcoz/Bundle/CoreBundle/Entity/UserRepository.php b/src/Bidcoz/Bundle/CoreBundle/Entity/UserRepository.php index b19df23..2915957 100644 --- a/src/Bidcoz/Bundle/CoreBundle/Entity/UserRepository.php +++ b/src/Bidcoz/Bundle/CoreBundle/Entity/UserRepository.php @@ -12,6 +12,10 @@ public function getUser() : User $address = new Address(); $address->setAddress1('123 ABC Street'); + $address->setAddress2('floor 1, apartment 1'); + $address->setCity('New York'); + $address->setState('New York'); + $address->setZip('10000'); $user->setAddress($address); diff --git a/src/Bidcoz/Bundle/FrontendBundle/Resources/views/Homepage/homepage.html.twig b/src/Bidcoz/Bundle/FrontendBundle/Resources/views/Homepage/homepage.html.twig index 5f9dba2..b85df77 100644 --- a/src/Bidcoz/Bundle/FrontendBundle/Resources/views/Homepage/homepage.html.twig +++ b/src/Bidcoz/Bundle/FrontendBundle/Resources/views/Homepage/homepage.html.twig @@ -8,6 +8,14 @@
+ {{ truncateText('Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut + labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco + laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in + voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat + non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.', 350) }} +