How can i define an array as a property in model class?
let me conclude what i did...
my model class that contains an array
class Author {
/**
* @var string {@from body}
* name of the Author {@required true}
*/
public $name = 'Name';
/**
* @var string {@type email} {@from body}
* email id of the Author
*/
public $email = 'name@domain.com';
/**
* @var array $arr {@type array} array of person
* {@required true}
*/
public $arr = array();
}
my function to test throw restler is:
/**
* POST
* post Author
*
* @param {@type Author} $a
*
* @return Author
*/
function postAuthor(Author $a) {
return $a;
}
when i try to test and class function remotely throw index.html it returns as value:
{
"name":"",
"email":"",
"arr":""
}
what i need is to return it as follow:
{
"name":"",
"email":"",
"arr":[]
}
How and what i have to do to make that?