$user = $this->Session->read('Auth');
produces the following array:
array(
'User' => array(
'id' => '2',
'email' => 'info@trinoweb.com',
'username' => 'trino',
'created' => '2012-10-11 12:41:52',
'modified' => '2012-10-11 12:41:52',
'last_online' => null,
'main_image' => null,
'address' => null
)
)
I want it to produce the same thing but with all the joins/relationships… like so…
array(
'User' => array(
'password' => '*****',
'id' => '128',
'email' => '12312@asdas.com',
'username' => 'teresa',
'created' => '2012-10-11 12:41:52',
'modified' => '2012-10-11 12:41:52',
'last_online' => null,
'main_image' => null,
'address' => null
),
'Inbox' => array(),
'Sender' => array(),
'Upload' => array()
)
thanks in advance.
No, not unless you write it in there when the Auth key is populated. This is a session variable, not a dynamic lookup on the models.
You will need to basically modify the login methods to do a lookup on these relationships and populate the Session data then.
Bear in mind, that this will be STATIC data. If you change a relationship, that will not be reflected in this array. You will need to update this array when that happens, and then it’s going to get messy.