You are here

function pmpapi_query_tools_get_query in Public Media Platform API Integration 7

Gets data for a given query.

Parameters

string $query: Name of a saved PMP query.

Return value

array The query parameters for the query, or NULL, if the query does not exist.

1 call to pmpapi_query_tools_get_query()
pmpapi_query_tools_admin_config in pmpapi_query_tools/pmpapi_query_tools.admin.inc
Form constructor for the PMPAPI query admin form.

File

pmpapi_query_tools/pmpapi_query_tools.module, line 75
Allows admins to build, save, and execute PMP queries

Code

function pmpapi_query_tools_get_query($query) {
  $result = db_query('SELECT options FROM pmpapi_query_tools_queries WHERE name=:name', array(
    ':name' => $query,
  ))
    ->fetchField(0);
  if ($result) {
    return unserialize($result);
  }
}