|
1234567891011121314151617181920212223242526272829303132333435363738394041 |
- <?php
-
- namespace Lc\ShopBundle\Services ;
-
- use Lc\ShopBundle\Context\AddressInterface;
-
- class AddressUtils
- {
- public function getSummaryShort(AddressInterface $address)
- {
- return $address->getAddress().' - '.$address->getZip().' '.$address->getCity() ;
- }
-
- public function getSummary(AddressInterface $address)
- {
- $html = '' ;
-
- if($address->getTitle()) {
- $html .= $address->getTitle().'<br />' ;
- }
-
- if($address->getLastname() || $address->getFirstname()) {
- $html .= $address->getLastname().' '.$address->getFirstname().'<br />' ;
- }
-
- if($address->getAddress()) {
- $html .= $address->getAddress().'<br />' ;
- }
-
- if($address->getZip() || $address->getCity()) {
- $html .= $address->getZip().' '.$address->getCity().'<br />' ;
- }
-
- if($address->getPhone()) {
- $html .= 'Tél. '.$address->getPhone() ;
- }
-
- return $html ;
- }
-
- }
|