Query Builder

  1. privatemsg
    1. 1 privatemsg.api.php
    2. 6-2 privatemsg.api.php
    3. 7-1 privatemsg.api.php
    4. 7-2 privatemsg.api.php

Query builder and related hooks

Privatemsg uses SelectQuery combined with custom tags to allow to customize almost all SELECT queries. For more information about SelectQuery, see http://drupal.org/developing/api/database and http://drupal.org/node/310075.

Arguments to a given query is stored in the metadata, with numerical keys (arg_%d) according to the position of the argument.

Functions & methods

NameDescription
hook_query_privatemsg_autocomplete_alterQuery to search for autocomplete usernames.
hook_query_privatemsg_deleted_alterAlter the query that loads deleted messages to flush them.
hook_query_privatemsg_messages_alterQuery definition to load messages of one or multiple threads.
hook_query_privatemsg_participants_alterAlter the query that loads the participants of a thread.
hook_query_privatemsg_sql_list_alterDisplay a list of threads.
hook_query_privatemsg_unread_count_alterLoads all unread messages of a user (only the count query is used).
privatemsg_sql_autocompleteLooks up autocomplete suggestions for users.
privatemsg_sql_deletedQuery Builder function to load all messages that should be flushed.
privatemsg_sql_listQuery definition to load a list of threads.
privatemsg_sql_messagesQuery definition to load messages of one or multiple threads.
privatemsg_sql_participantsLoad all participants of a thread.
privatemsg_sql_unread_countCount threads with unread messages.
_privatemsg_assemble_queryGenerates a query based on a query id.

File

./privatemsg.api.php, line 21
Privatemsg API Documentation

Add new comment

Filtered HTML

  • Web page addresses and e-mail addresses turn into links automatically.
  • Allowed HTML tags: <a> <em> <strong> <cite> <blockquote> <code> <ul> <ol> <li> <dl> <dt> <dd>
  • Lines and paragraphs break automatically.

Plain text

  • No HTML tags allowed.
  • Web page addresses and e-mail addresses turn into links automatically.
  • Lines and paragraphs break automatically.