Pārlūkot izejas kodu

AddressUtils

feature/export_comptable
Guillaume pirms 4 gadiem
vecāks
revīzija
bc54ef02e6
1 mainītis faili ar 41 papildinājumiem un 0 dzēšanām
  1. +41
    -0
      ShopBundle/Services/AddressUtils.php

+ 41
- 0
ShopBundle/Services/AddressUtils.php Parādīt failu

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

}

Notiek ielāde…
Atcelt
Saglabāt