Zend_Soap : How to define return type struct in doc block?
-
26-09-2019 - |
문제
I have a Web service set up using Zend_Soap, and some public methods in that Web service. The fact is i want to return a complex type.
For instance, if i want to return a bidimensional array, like a rowset of a table how should i specify the doc block? This is one of my cases. I want to return an array each element having an int and two strings. Like:
[0] = {1 , NameA, StringA }
[1] = {4 , NameB, StringB }
[2] = {6 , NameC, StringC }
[3] = {9 , NameD, StringD }
How can i achieve this? Then how can i make even more complex by, say, replace the 3rd field with another array of an int and a string?
TIA
해결책
Use Zend_Soap_AutoDiscover http://framework.zend.com/manual/en/zend.soap.autodiscovery.html
With it you just have to define your complex type
class complexType {
/*put your definitions of class here*/
}
and put it in phpdoc like this
/**
*
* @param int $id
* @return complexType
*/
public function getSomething($id) {
제휴하지 않습니다 StackOverflow