$requestParamName
$requestParamName : string
ApiRelationProvider
Example:
$relationProvider = new ApiRelationProvider(
array(
"config"=>array(
"comments"=>array( //HAS_MANY relation
"columnName"=>"comments",
"relationName"=>"comments",
"return"=>"array" //string ("object"|"array") return CActiveRecord object or array
),
"profile"=>array( //HAS_ONE relation
"columnName"=>"profile",
"relationName"=>"profile",
"return"=>"array" //string ("object"|"array") return CActiveRecord object or array
),
),
"model"=>$model //CActiveRecord $model for fetching relation data
));
$model = User::model()->findByPk(1);
$relations = $relationProvider->getData($model);
The above example returns the following array:
array(
'comments'=>array(
array(
'id'=>'42',
'content'=>'comment 42 content',
...
),
array(
'id'=>'81',
'content'=>'comment 81 content',
...
),
...
),
'profile'=>array(
'userid'=>'1',
'name'=>'username',
'login'=>'userlogin',
'email'=>'user@email.com',
...
)
)
$relationsConfig : array