BxDolLocationMap.php 1.8 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455
  1. <?php defined('BX_DOL') or die('hack attempt');
  2. /**
  3. * Copyright (c) UNA, Inc - https://una.io
  4. * MIT License - https://opensource.org/licenses/MIT
  5. *
  6. * @defgroup UnaCore UNA Core
  7. * @{
  8. */
  9. /**
  10. * This class allow different implementations for displaying maps.
  11. *
  12. * Add record to sys_objects_location_map table, like you are doing this for Comments or Voting objects:
  13. * - object: your object name, usually it is in the following format - vendor prefix, underscore, module prefix;
  14. * - module: module name
  15. * - title: translatable title
  16. * - class_name: user defined class name which is derived from BxDolLocationField.
  17. * - class_file: the location of the user defined class, leave it empty if class is located in system folders.
  18. */
  19. class BxDolLocationMap extends BxDolFactoryObject
  20. {
  21. protected function __construct($aObject, $oTemplate = null)
  22. {
  23. parent::__construct($aObject, $oTemplate, 'BxDolLocationFieldQuery');
  24. }
  25. /**
  26. * Get object instance by object name
  27. * @param $sObject object name
  28. * @return object instance or false on error
  29. */
  30. public static function getObjectInstance($sObject, $oTemplate = null)
  31. {
  32. return parent::getObjectInstanceByClassNames($sObject, $oTemplate, 'BxDolLocationMap', 'BxDolLocationMapQuery');
  33. }
  34. /**
  35. * Get location map for single address
  36. * @param $aLocation location array with the following indexes:
  37. * lat, lng, country, state, city, zip, street, street_number
  38. * @param $sLocationHtml formatted address string
  39. * @param $aParams some specific params
  40. */
  41. public function getMapSingle($aLocation, $sLocationHtml = '', $aParams = array())
  42. {
  43. // override this method
  44. return '';
  45. }
  46. public function addCssJs()
  47. {
  48. }
  49. }
  50. /** @} */