1 | <?php |
||
13 | class Service extends AbstractModel |
||
14 | { |
||
15 | /** |
||
16 | * @var string |
||
17 | */ |
||
18 | const DEFAULT_SERVICE_CLASS_NAME = 'Service'; |
||
19 | /** |
||
20 | * Store the methods of the service |
||
21 | * @var MethodContainer |
||
22 | */ |
||
23 | private $methods; |
||
24 | /** |
||
25 | * Main constructor |
||
26 | * @see AbstractModel::__construct() |
||
27 | * @uses Service::setMethods() |
||
28 | * @param Generator $generator |
||
29 | * @param string $name the service name |
||
30 | */ |
||
31 | 810 | public function __construct(Generator $generator, $name) |
|
36 | /** |
||
37 | * Returns the contextual part of the class name for the package |
||
38 | * @see AbstractModel::getContextualPart() |
||
39 | * @return string |
||
40 | */ |
||
41 | 798 | public function getContextualPart() |
|
45 | /** |
||
46 | * Returns the sub package name which the model belongs to |
||
47 | * Must be overridden by sub classes |
||
48 | * @see AbstractModel::getDocSubPackages() |
||
49 | * @return array |
||
50 | */ |
||
51 | 132 | public function getDocSubPackages() |
|
57 | /** |
||
58 | * Returns the methods of the service |
||
59 | * @return MethodContainer |
||
60 | */ |
||
61 | 204 | public function getMethods() |
|
65 | /** |
||
66 | * Sets the methods container |
||
67 | * @param MethodContainer $methodContainer |
||
68 | * @return Service |
||
69 | */ |
||
70 | 810 | private function setMethods(MethodContainer $methodContainer) |
|
75 | /** |
||
76 | * Adds a method to the service |
||
77 | * @uses Method::setUnique() |
||
78 | * @param string $methodName original method name |
||
79 | * @param string|array $methodParameterType original parameter type/name |
||
80 | * @param string|array $methodReturnType original return type/name |
||
81 | * @param bool $methodIsUnique original isUnique value |
||
82 | * @return Method |
||
83 | */ |
||
84 | 792 | public function addMethod($methodName, $methodParameterType, $methodReturnType, $methodIsUnique = true) |
|
90 | /** |
||
91 | * Returns the method by its original name |
||
92 | * @uses Service::getMethods() |
||
93 | * @uses AbstractModel::getName() |
||
94 | * @param string $methodName the original method name |
||
95 | * @return Method|null |
||
96 | */ |
||
97 | 804 | public function getMethod($methodName) |
|
101 | /** |
||
102 | * Allows to define from which class the curent model extends |
||
103 | * @param bool $short |
||
104 | * @return string |
||
105 | */ |
||
106 | 132 | public function getExtends($short = false) |
|
111 | /** |
||
112 | * @param $filename |
||
113 | * @return ServiceReservedMethod |
||
114 | */ |
||
115 | 6 | public function getReservedMethodsInstance($filename = null) |
|
119 | /** |
||
120 | * {@inheritDoc} |
||
121 | * @see \WsdlToPhp\PackageGenerator\Model\AbstractModel::toJsonSerialize() |
||
122 | */ |
||
123 | protected function toJsonSerialize() |
||
129 | /** |
||
130 | * @param array $methods |
||
131 | */ |
||
132 | public function setMethodsFromSerializedJson(array $methods) |
||
138 | } |
||
139 |