Source for file city.php

Documentation is available at city.php

  1. <?php
  2. /**
  3. * @package org.routamc.positioning
  4. * @author The Midgard Project, http://www.midgard-project.org
  5. * @version $Id: city.php 3757 2006-07-27 14:32:42Z bergie $
  6. * @copyright The Midgard Project, http://www.midgard-project.org
  7. * @license http://www.gnu.org/licenses/lgpl.html GNU Lesser General Public License
  8. */
  9.  
  10. /**
  11. * MidCOM wrapper class for city objects
  12. *
  13. * @package org.routamc.positioning
  14. */
  15. class org_routamc_positioning_city_dba extends __org_routamc_positioning_city_dba
  16. {
  17. function org_routamc_positioning_city_dba($id = null)
  18. {
  19. return parent::__org_routamc_positioning_city_dba($id);
  20. }
  21. /**
  22. * Don't save city if another city is in same place
  23. */
  24. function _on_creating()
  25. {
  26. $qb = org_routamc_positioning_city_dba::new_query_builder();
  27. $qb->add_constraint('longitude', '=', $this->longitude);
  28. $qb->add_constraint('latitude', '=', $this->latitude);
  29. $qb->set_limit(1);
  30. $matches = $qb->execute_unchecked();
  31. if (count($matches) > 0)
  32. {
  33. // We don't need to save duplicate entries
  34. return false;
  35. }
  36. return parent::_on_creating();
  37. }
  38. }
  39. ?>

Documentation generated on Tue, 15 Aug 2006 12:23:22 +0300 by phpDocumentor 1.3.0RC3