General Newbie Problems :)


Sorry for the very newbie questions. I think I have to understand better this thing, but got basic misunderstandings and need help. I created a full app with login, logout, listings, widgets, etc. Most of them works.

My main problem is that I could not add a new field to my user table with full functionality. I added "provider" sql field. When I write a new user (->save) then it works, but on setstates it is empty and app stops with no property error…

I tried to do this in Useridentity.php:


$this->setState('provider', $user->provider);

Username is working but when trying to print it with Yii::app()->user->provider, it fails with property error…

Other basic problem I can’t print out a “model” to see all parts and data inside it. I wanted to verify my new property “provider” why not and another problem found:

echo 'username: '.Yii::app()->user->name.'<br>';


On output the user name is the right string, but dumping the whole thing (Yii::app()->user) cannot see any data which is important for me, no username, email, etc… Just this:



    [allowAutoLogin] => true

    [guestName] => 'Guest'

    [loginUrl] => array


        0 => '/user/login'


    [identityCookie] => null

    [authTimeout] => null

    [absoluteAuthTimeout] => null

    [autoRenewCookie] => false

    [autoUpdateFlash] => true

    [loginRequiredAjaxResponse] => null

    [CWebUser:_keyPrefix] => 'cd36d3a0f4ad34aa1e7e095b9cdc8669'

    [CWebUser:_access] => array()

    [behaviors] => array()

    [CApplicationComponent:_initialized] => true

    [CComponent:_e] => null

    [CComponent:_m] => null


How Can I see the whole model data?

Sorry for bad english also and any help would be good.

Thanks and regards! :)

Sorry the first problem solved, I had to add the new field to the "notsafe" scopes in user model. I am confused why is it neccesary and why do we need scope, but in Useridentity this is the checking part nad now works.


The second question is still actual, thanks. :)