|
|
@@ -0,0 +1,41 @@ |
|
|
|
<?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 ; |
|
|
|
} |
|
|
|
|
|
|
|
} |