1 | <?php |
||
25 | class Help |
||
26 | { |
||
27 | // only use in verbose mode. |
||
28 | public $private_nodeName = 'verbose'; |
||
29 | |||
30 | private $rel_path = '/help'; |
||
31 | |||
32 | /** |
||
33 | * Help - Provides in-line referencial to this API. |
||
34 | * |
||
35 | * This resource entity provides documentation and in-line referencial to this API's resources. |
||
36 | * By specify a resource and method you can narrow down to specific section. |
||
37 | * |
||
38 | * @param string $resource Optional. A string of characters used to identify |
||
39 | * a specific resource entity. |
||
40 | * e.g. /help/resource |
||
41 | * @param array $filters Optional. Some filters to narrow down the resultset. |
||
42 | * @global string $method Default "GET". The resource HTTP method to interact. |
||
43 | * @return array An array documentating either all the available resources |
||
44 | * or if provided, the specified <b>:resource</b>. |
||
45 | * |
||
46 | * @example <p><pre>apixs: |
||
47 | * help: |
||
48 | * title: Help - Provides in-line referencial to this API. |
||
49 | * description: This resource entity provides documentation and ... |
||
50 | * </pre></p> |
||
51 | * @see http://www.w3.org/Protocols/rfc2616/rfc2616-sec9.html#sec9.2 |
||
52 | */ |
||
53 | public function onRead($resource=null, array $filters=null) |
||
75 | |||
76 | /** |
||
77 | * Outputs info for a resource entity. |
||
78 | * |
||
79 | * The OPTIONS method represents a request for information about the |
||
80 | * communication options available on the request/response chain |
||
81 | * identified by the Request-URI. This method allows the client to determine |
||
82 | * the options and/or requirements associated with a resource, |
||
83 | * or the capabilities of a server, without implying a resource action or |
||
84 | * initiating a resource retrieval. |
||
85 | * |
||
86 | * |
||
87 | * @param Server $server The main server object. |
||
88 | * @param array $filters An array of filters. |
||
89 | * @return array An array of documentation data. |
||
90 | * |
||
91 | * @api_link OPTIONS /path/to/entity |
||
92 | * @api_link OPTIONS /* |
||
93 | * @apix_man_toc_hidden |
||
94 | */ |
||
95 | public function onHelp(Server $server, array $filters=null) |
||
134 | |||
135 | /** |
||
136 | * Get the documentation of all the resource entities. |
||
137 | * |
||
138 | * @param Server $server |
||
139 | * @return array The documentation for all resource entities. |
||
140 | */ |
||
141 | public static function getResourcesDocs(Server $server) |
||
161 | |||
162 | /** |
||
163 | * Get the documentation for the provided entity and method. |
||
164 | * |
||
165 | * @param EntityInterface $entity The Entity object to interact with. |
||
166 | * @param string|null $method Optional. The Request-method or all. |
||
167 | * @param string|null $path Optional. Request-URI for that entity. |
||
168 | * @return array The entity array documentation. |
||
169 | */ |
||
170 | public static function getEntityDocs(Entity $entity, $method=null, $path=null) |
||
181 | |||
182 | } |
||
183 |
This check looks from parameters that have been defined for a function or method, but which are not used in the method body.