Example #1
0
 public function setEncrypt($encrypt)
 {
     $this->encrypt = Php7Handler::Boolval($encrypt);
     return $this;
 }
Example #2
0
 private function setUserFieldsByUsedDbRow(array $dbRow)
 {
     $cordsPresent = false;
     foreach ($dbRow as $key => $value) {
         switch ($key) {
             case 'user_id':
                 $this->userId = (int) $value;
                 break;
             case 'username':
                 $this->userName = $value;
                 break;
             case 'founds_count':
                 $this->foundGeocachesCount = (int) $value;
                 break;
             case 'notfounds_count':
                 $this->notFoundGeocachesCount = (int) $value;
                 break;
             case 'hidden_count':
                 $this->hiddenGeocachesCount = (int) $value;
                 break;
             case 'email':
                 $this->email = $value;
                 break;
             case 'country':
                 $this->country = $value;
                 break;
             case 'latitude':
             case 'longitude':
                 // lat|lon are handling below
                 $cordsPresent = true;
                 break;
             case 'admin':
                 $this->isAdmin = Php7Handler::Boolval($value);
                 break;
             case 'guru':
                 $this->isGuide = Php7Handler::Boolval($value);
                 break;
             case 'log_notes_count':
                 $this->logNotesCount = $value;
                 break;
                 /* db fields not used in this class yet*/
             /* db fields not used in this class yet*/
             case 'password':
             case 'last_login':
             case 'is_active_flag':
             case 'hide_flag':
             case 'date_created':
             case 'description':
                 // just skip it...
                 break;
             default:
                 error_log(__METHOD__ . ": Unknown column: {$key}");
         }
     }
     // if coordinates are present set the homeCords.
     if ($cordsPresent) {
         $this->homeCoordinates = new \lib\Objects\Coordinates\Coordinates(array('dbRow' => $dbRow));
     }
     $this->dataLoaded = true;
     //mark object as containing data
 }