You are here

menu_service.module in Services 7

Adds a service type for a menu

@note This file has a 80 character width limit for all lines

File

services/menu_service/menu_service.module
View source
<?php

/**
 * @file
 * Adds a service type for a menu
 *
 * @note This file has a 80 character width limit for all lines
 */

/**
 * Implementation of hook_service().
 */
function menu_service_service() {
  return array(
    array(
      '#method' => 'menu.get',
      '#callback' => 'menu_service_get',
      '#file' => array(
        'file' => 'inc',
        'module' => 'menu_service',
      ),
      '#args' => array(
        array(
          '#name' => 'menu_id',
          '#type' => 'string',
          '#optional' => TRUE,
          '#description' => t('Menu ID. Defaults to "primary-links".'),
        ),
        array(
          '#name' => 'fields',
          '#type' => 'array',
          '#optional' => TRUE,
          '#description' => t('An list of fields to return. If left empty, all fields will be returned '),
        ),
      ),
      '#return' => 'array',
      '#help' => t('Retrieves a menu tree.'),
    ),
  );
}

Functions

Namesort descending Description
menu_service_service Implementation of hook_service().