Hi all!
On the server side :
// If my model is (1-N relation between Foo and Bar) :
class Foo extends CActiveRecord {
/**
* @var Bar[] bars {nillable=false, minOccurs=1, maxOccurs=unbounded}
* @soap
*/
public $bars;
// ...
public function relations() {
return array(
'bars' => array(self::HAS_MANY, 'Bar', 'id_foo'),
);
}
// ...
}
// then
var_dump($foo->bars);
// always returns NULL, event if there actually are some related models in the database
When we declare the public attribute for the SOAP web service (to expose it in the WSDL) with the same name as the relation, we kind of mess up the model, resulting in the attribute always returning NULL…
Cheers!