original_string: protected static function addUser($ip, $url)
      {
          if (!$user = User::findMe()) {
              return false;
          }
  
          $activity = static::find()->where(['user_id' => $user->id])->limit(1)->one();
          if (!$activity) {
              $activity = new static;
              $activity->user_id = $user->id;
          }
          $activity->username = $user->podiumName;
          $activity->user_role = $user->role;
          $activity->user_slug = $user->podiumSlug;
          $activity->url = $url;
          $activity->ip = $ip;
          $activity->anonymous = !empty($user->meta) ? $user->meta->anonymous : 0;
  
          return $activity->save();
      }
code: protected static function addUser($ip, $url)
      {
          if (!$user = User::findMe()) {
              return false;
          }
  
          $activity = static::find()->where(['user_id' => $user->id])->limit(1)->one();
          if (!$activity) {
              $activity = new static;
              $activity->user_id = $user->id;
          }
          $activity->username = $user->podiumName;
          $activity->user_role = $user->role;
          $activity->user_slug = $user->podiumSlug;
          $activity->url = $url;
          $activity->ip = $ip;
          $activity->anonymous = !empty($user->meta) ? $user->meta->anonymous : 0;
  
          return $activity->save();
      }
code_tokens: protected static function addUser ( $ ip , $ url ) { if ( ! $ user = User :: findMe ( ) ) { return false ; } $ activity = static :: find ( ) -> where ( [ 'user_id' => $ user -> id ] ) -> limit ( 1 ) -> one ( ) ; if ( ! $ activity ) { $ activity = new static ; $ activity -> user_id = $ user -> id ; } $ activity -> username = $ user -> podiumName ; $ activity -> user_role = $ user -> role ; $ activity -> user_slug = $ user -> podiumSlug ; $ activity -> url = $ url ; $ activity -> ip = $ ip ; $ activity -> anonymous = ! empty ( $ user -> meta ) ? $ user -> meta -> anonymous : 0 ; return $ activity -> save ( ) ; }
docstring: Adds registered user activity.
  @param string $ip
  @param string $url
  @return bool
  @since 0.6
docstring_tokens: Adds registered user activity .