/**
  * Returns class instance
  *
  * @return SKADATE_BOL_CurrentLocationDao
  */
 public static function getInstance()
 {
     if (self::$classInstance === null) {
         self::$classInstance = new self();
     }
     return self::$classInstance;
 }
Beispiel #2
0
 public function setUserCurrentLocation($userId, $latitude, $longitude)
 {
     if (!$userId) {
         return false;
     }
     $location = $this->getUserCurrentLocation($userId);
     if (!$location) {
         $location = new SKADATE_BOL_CurrentLocation();
         $location->userId = $userId;
     }
     $location->latitude = floatval($latitude);
     $location->longitude = floatval($longitude);
     $location->updateTimestamp = time();
     SKADATE_BOL_CurrentLocationDao::getInstance()->save($location);
     return true;
 }
Beispiel #3
0
 public function removeCurrentLocationByUserId($userId)
 {
     SKADATE_BOL_CurrentLocationDao::getInstance()->deleteByUserId($userId);
     return true;
 }