This is my query:
Open::findOne()->where(['username' => $username]);
and this is the result var dumped:
object(app\models\User)[81]
public 'id' => null
public 'username' => null
public 'password' => null
public 'authKey' => null
public 'accessToken' => null
private '_attributes' (yii\db\BaseActiveRecord) =>
array (size=3)
'id' => int 1
'username' => string 'admin' (length=5)
'password' => string 'admin' (length=5)
private '_oldAttributes' (yii\db\BaseActiveRecord) =>
array (size=3)
'id' => int 1
'username' => string 'admin' (length=5)
'password' => string 'admin' (length=5)
private '_related' (yii\db\BaseActiveRecord) =>
array (size=0)
empty
private '_errors' (yii\base\Model) => null
private '_validators' (yii\base\Model) => null
private '_scenario' (yii\base\Model) => string 'default' (length=7)
private '_events' (yii\base\Component) =>
array (size=0)
empty
private '_behaviors' (yii\base\Component) =>
array (size=0)
empty
Why attributes are null?