Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
tree: 7dfbb468ea
Fetching contributors…

Cannot retrieve contributors at this time

file 48 lines (48 sloc) 1.75 kb
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48
/**{% filter block_comment %}
 * {{ method.description }} ({% if resource %}{{ resource.wireName }}.{% endif %}{{ method.wireName }})
 * {% endfilter %}
 *
{% filter noblanklines %}
{% for param in method.required_parameters %}
 * @param {{ param.codeType }} ${{ param.codeName }} {{ param.description }}{% endfor %}
{% if method.requestType %}
 * @param $postBody the {@link {{ method.requestType.className }}}
{% endif %}
{% if method.optional_parameters %}
 * @param array $optParams Optional parameters. Valid optional parameters are listed below.
 *{% for param in method.optional_parameters %}
 * @opt_param {{ param.codeType }} {{ param.wireName }} {{ param.description }}{% endfor %}
{% endif %}
{% if method.response %}
 *
 * @return {{ method.responseType.className }}
{% endif %}
 */
{% endfilter %}
public function {{ method.name }}({% call_template _func_params method method %})
{
{% filter noblanklines %}
{% indent %}$params = array({% parameter_list %}
    {% for p in method.requiredParameters %}
      {% parameter %}'{{ p.wireName }}' => ${{ p.codeName }}{% end_parameter %}
    {% endfor %}
    {% if method.requestType %}
      {% parameter %}'postBody' => $postBody{% end_parameter %}
    {% endif %}
  {% end_parameter_list %});{% endindent %}
{% if method.optional_parameters %}
{% indent %}$params = array_merge($params, $optParams);{% endindent %}
{% endif %}
{% indent %}$data = $this->__call('{{ method.wireName }}', array($params));{% endindent %}
{% indent %}{% if method.response %}
if ($this->useObjects()) {
{% indent %}return new {{ method.responseType.className }}($data);{% endindent %}
} else {
{% indent %}return $data;{% endindent %}
}
{% else %}
  return $data;
{% endif %}
{% endindent %}
{% endfilter %}
}
Something went wrong with that request. Please try again.