thanks for your input. Yeah hopefully we can nut this out.
where abouts do i put the print_($user)? so i can check data. By using the log I can see that the sql performed by AR and that tells me that the data is definately being selected. I just don't know how to call on the value correctly
You can check this reply from Tommy too, I got mine working now.
For each [0]s, you'll need to treat it as an array, and do a foreach to retrieve the object out, once it's out you can access that object's value.
you can print_r($user) anywhere you like after $user is populated, just to take a peek into the array. From there, you can work out how the data is structured inside the array, and you'll end up with what I did just now.
In your case, I would say
$user contains an array of users or 1 user (I would call it $users)
A foreach ($users as $user) would retrieve the User object from the $users array
Inside the User object($user), profile object can be accessed $user->profile[X]
You'll need to do a for each ($user->profiles) as $profile as well. This will retrieve the Profile Object // profile table.
Now to get to contact_info table, repeat again, foreach($profile->contact_infos as $contact_info)
6)Once you've arrived at the contact_info object, you can $contact_info->screen_name
I am very new and still learning php and yii so its proving difficult for something i would have thought should be a simple task.
It seems to hard to retrieve data from a related AR query!!! All I want to do is assign the value of the 'screen_name' in the table 'contact_info' to $this->username in UserIdentity.
When i action the query and test I can see the 'screen_name' value is in column t2_c5. I just want to retrieve it!!!