Community Documentation

hook_service configuration keys

Last updated October 26, 2010. Created by PieterDC on April 19, 2009.
Edited by kylebrowning. Log in to edit this page.

These keys can be used when implementing hook_service

#method
(required) Public method name. If it contains a dot, the part before the dot is assumed to be the namespace, the other part: function name.
#callback
(required) Function name of the method in your code.
#access callback
Which function does some access control? If not defined, the user_access function will be used.
#access arguments
Arguments for the '#access callback' function. If not defined access arguments will be ignored.
#file
Which file defines the '#callback' function? If node_service.inc, then write array('file' => 'inc', 'module' => 'node_service'). This is not required if you define your methods in the .module file.
#key
Does this method require a key? Default: TRUE
#auth
Does this method require a session id? Default: TRUE
#args
The arguments of the callback function. For each argument, you can define the following keys:
#name
Argument name
#type
Argument data type. Choose one of these: boolean, double, int, string, array, struct, date or base64, see xmlrpc_value_calculate_type(). Ps: you can use 'big' to get a textarea in services admin browser but it really is data type 'string'.
#description
Help text.
#optional
Is this argument required? Default: FALSE
#signed
Include this argument when computing the hash? Default: FALSE
#title
Label used with this argument's form element on the services admin browse form of this method. Default: '#name'.
#return
Return value data type. Same possibilities as with argument type.
#help
Method help text.

Comments

'access services' does not

'access services' does not appear to be a permission that comes with services, only 'administer services'

Page status

No known problems

Log in to edit this page

About this page

Drupal version
Drupal 6.x
Audience
Developers and coders

Develop for Drupal

Drupal’s online documentation is © 2000-2012 by the individual contributors and can be used in accordance with the Creative Commons License, Attribution-ShareAlike 2.0. PHP code is distributed under the GNU General Public License.