You are here

pmpapi_query_tools.api.php in Public Media Platform API Integration 7

Hooks provided by the PMPAPI query tools module.

File

pmpapi_query_tools/pmpapi_query_tools.api.php
View source
<?php

/**
 * @file
 * Hooks provided by the PMPAPI query tools module.
 */

/**
 * Act on a PMP query before it is executed.
 *
 * @param array $options
 *   Key/value pairs of PMP query options.
 *
 * @param string $query
 *   Machine name of the query.
 */
function hook_pmpapi_query_tools_query_pre_execute_alter(&$options, $query) {
  if (!$options['limit']) {

    // Let's throttle!
    $options['limit'] = 1;
  }
}

/**
 * Respond to a query being deleted.
 *
 * @param string $query
 *   Machine name of the query.
 */
function hook_pmpapi_query_tools_query_delete($query) {
  variable_del('my_module_added_variable_' . $query);
}

Functions

Namesort descending Description
hook_pmpapi_query_tools_query_delete Respond to a query being deleted.
hook_pmpapi_query_tools_query_pre_execute_alter Act on a PMP query before it is executed.