浏览代码

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

}

正在加载...
取消
保存