title: Yii2 save() creating DB row with default values
body: <p>I am trying to implement a login method using OpenID, and the $_SESSION var's are posting correctly - and through those I am simply trying to register users in MySQL. For some reason, when passing through the 'login' action in my controller :: </p>
  
  <pre><code>    public function actionLogin()
  {
      if (!Yii::$app-&gt;user-&gt;isGuest) {
          return $this-&gt;goHome();
      }
  
      include ('../views/user-record/steamauth/userInfo.php');
  
      $steamid = $_SESSION['steam_steamid'];
      $username = $_SESSION['steam_personaname'];
      $profileurl = $_SESSION['steam_profileurl'];
      $avatar = $_SESSION['steam_avatar'];
      $avatarmedium = $_SESSION['steam_avatarmedium'];
      $avatarfull = $_SESSION['steam_avatarfull'];
  
      $user = UserRecord::findBySteamId($steamid);
  
      if ($user === null)
      {
          $user = new UserRecord();
  
          $user-&gt;steamid = $steamid;
          $user-&gt;username = $username;
          $user-&gt;profileurl = $profileurl;
          $user-&gt;avatar = $avatar;
          $user-&gt;avatarmedium = $avatarmedium;
          $user-&gt;avatarfull = $avatarfull;
          $user-&gt;verified = 0;
          $user-&gt;banned = 0;
  
          $user-&gt;save();
      }
  
      Yii::$app-&gt;user-&gt;login($user, 604800);
  
      return $this-&gt;redirect(Yii::$app-&gt;user-&gt;returnUrl);
  }
  </code></pre>
  
  <p>EDIT: Here is the UserRecord class, forgot to add it in.</p>
  
  <pre><code>&lt;?php
  
  namespace app\models;
  
  class UserRecord extends \yii\db\ActiveRecord implements \yii\web\IdentityInterface
  {
      public $id;
      public $steamid;
      public $username;
      public $profileurl;
      public $avatar;
      public $avatarmedium;
      public $avatarfull;
  
      public $verified;
      public $banned;
      public $rank;
      public $authKey;
  
  //    public $password;
  //    public $accessToken;
  
      public static function tableName()
      {
          return 'users';
      }
  
      public function getAuthKey() 
      {
          return $this-&gt;authKey;
      }
  
      public function getId()
      {
          return $this-&gt;id;
      }
  
      public function validateAuthKey($authKey)
      {
          return $this-&gt;authKey === $authKey;
      }
  
      public static function findIdentity($id)
      {
          return self::findOne($id);
      }
  
      public function validateSteamID($steamid)
      {
          return $this-&gt;steamid === $steamid;
      }
  
      public static function findIdentityByAccessToken($token, $type = null)
      {
          throw new \yii\base\NotSupportedException;
      }
  
      public static function findBySteamId($steamid)
      {
          return self::findOne(['steamid' =&gt; $steamid]);
      }
  
  }
  </code></pre>
  
  <p>The result is simply a posted row, with none of the data entered.</p>
  
  <p>Any help would be greatly appreciated, thank you.</p>