Yii Framework Forum: One Veiw With All Relationd - Yii Framework Forum

Jump to content

Page 1 of 1
  • You cannot start a new topic
  • You cannot reply to this topic

One Veiw With All Relationd Rate Topic: -----

#1 User is offline   jenniferschofi 

  • Newbie
  • Yii
  • Group: Members
  • Posts: 2
  • Joined: 05-January 14

Posted 12 January 2014 - 01:38 AM

I have 3 tables user, address and phone. They are related in the database. 1 user could have multible adress enteries and phone entries. Is there a way to display all the user information on 1page but no other user info

	
 * @property Address[] $addresses
 * @property Phone[] $phones
 */
public function relations()
	{
		// NOTE: you may need to adjust the relation name and the related
		// class name for the relations automatically generated below.
		return array(
			'addresses' => array(self::HAS_MANY, 'Address', 'user_id'),
			'phones' => array(self::HAS_MANY, 'Phone', 'user_id'),
		);
	}

0

Share this topic:


Page 1 of 1
  • You cannot start a new topic
  • You cannot reply to this topic

1 User(s) are reading this topic
0 members, 1 guests, 0 anonymous users