Web Service + Relation Fields

Hi everyone,

I’m having some trouble with a Web Service I’m implementing.

What I want it to do is to retrieve a list of objects, each has a list of another type of objects:





class A extends CActiveRecord

{

    /**

    * @var B[] bList

    * @soap

    */

    public $bList;

}


class B extends CActiveRecord

{

    /**

    * @var integer att

    * @soap

    */

    public $att;

}




but when I consume the Web Service I ask for an A class object. I can get it, but the bList attribute has the null value.

Is there any way I can set the relation attributes to be retrieved by the Web Service?

Thank you!

i didnt get u any way




Students::model()->findByAttributes(array('id'=>$data->student_id));


like


A::model()->ur attribute;

B::model()->ur attribute;



to set relation

in ur model




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(

		);

	}



You can add a with to your query. It will eagerly load the related models.