ソースを参照

AddressUtils

feature/export_comptable
Guillaume 4年前
コミット
bc54ef02e6
1個のファイルの変更41行の追加0行の削除
  1. +41
    -0
      ShopBundle/Services/AddressUtils.php

+ 41
- 0
ShopBundle/Services/AddressUtils.php ファイルの表示

@@ -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 ;
}

}

読み込み中…
キャンセル
保存