Du kan inte välja fler än 25 ämnen Ämnen måste starta med en bokstav eller siffra, kan innehålla bindestreck ('-') och vara max 35 tecken långa.

42 lines
1.2KB

  1. <?php
  2. namespace Lc\ShopBundle\Services ;
  3. use Lc\ShopBundle\Context\AddressInterface;
  4. class AddressUtils
  5. {
  6. public function getSummaryShort(AddressInterface $address)
  7. {
  8. return $address->getAddress().' - '.$address->getZip().' '.$address->getCity() ;
  9. }
  10. public function getSummary(AddressInterface $address)
  11. {
  12. $html = '' ;
  13. if($address->getTitle()) {
  14. $html .= $address->getTitle().'<br />' ;
  15. }
  16. if($address->getLastname() || $address->getFirstname()) {
  17. $html .= $address->getLastname().' '.$address->getFirstname().'<br />' ;
  18. }
  19. if($address->getAddress()) {
  20. $html .= $address->getAddress().'<br />' ;
  21. }
  22. if($address->getZip() || $address->getCity()) {
  23. $html .= $address->getZip().' '.$address->getCity().'<br />' ;
  24. }
  25. if($address->getPhone()) {
  26. $html .= 'Tél. '.$address->getPhone() ;
  27. }
  28. return $html ;
  29. }
  30. }