You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

63 lines
1.4KB

  1. <?php
  2. namespace Lc\CaracoleBundle\Solver\Address;
  3. class AddressSolver
  4. {
  5. // getAddressSummary
  6. public function getSummaryShort()
  7. {
  8. return $this->getAddress() . ' - ' . $this->getZip() . ' ' . $this->getCity();
  9. }
  10. public function getSummary($withTitle = true)
  11. {
  12. $html = '';
  13. if ($this->getTitle() && $withTitle) {
  14. $html .= $this->getTitle() . '<br />';
  15. }
  16. if ($this->getLastname() || $this->getFirstname()) {
  17. $html .= $this->getLastname() . ' ' . $this->getFirstname() . '<br />';
  18. }
  19. if ($this->getAddress()) {
  20. $html .= $this->getAddress() . '<br />';
  21. }
  22. if ($this->getZip() || $this->getCity()) {
  23. $html .= $this->getZip() . ' ' . $this->getCity() . '<br />';
  24. }
  25. if ($this->getPhone()) {
  26. foreach ($this->getPhone() as $phone) {
  27. $html .= 'Tél. ' . $phone . '<br />';
  28. }
  29. }
  30. return $html;
  31. }
  32. public function getLongitudeInherit()
  33. {
  34. if ($this->getLongitudeOverride()) {
  35. return $this->getLongitudeOverride();
  36. } else {
  37. return $this->getLongitude();
  38. }
  39. }
  40. public function getLatitudeInherit()
  41. {
  42. if ($this->getLatitudeOverride()) {
  43. return $this->getLatitudeOverride();
  44. } else {
  45. return $this->getLatitude();
  46. }
  47. }
  48. }