Hi!
I am currently working on a Yii Web Service as desribed in the tutorial. One web service method should return an array of a certain class called customer and is defined as
/**
* @return Customer[] all customers
* @soap
*/
public function getCustomers()
{
return Customer::model()->findAll();
}
The customer class is a gii generated CActiveRecord derivation and the properties are therefore not included explicitly. So I am not able to annotate them with the @soap annotation to include them in the webservice. This leads to an empty definition of Customers in the wsdl file. If I add a definition manually just like
/**
* @var integer post ID
* @soap
*/
public $pid;
to the Customer class it is included as it should.
Unfortunately there a really many attributes and I don’t want to include them by hand for each required class.
Any ideas how to get this done best? I thought about adding the @soap annotation to the property defintion created by gii at the beginning of the class
/**
* This is the model class for table "customer".
*
* The followings are the available columns in table 'customer':
* @property integer $id
* @property string $name
* @property string $department_1
...
but it didn’t work (or I misplaced it)
Thank you in advance!