You are here

function _privatemsg_limits_get_received in Privatemsg 7.2

Same name and namespace in other branches
  1. 6.2 privatemsg_limits/privatemsg_limits.module \_privatemsg_limits_get_received()
  2. 7 privatemsg_limits/privatemsg_limits.module \_privatemsg_limits_get_received()

Returns the number of messages/threads a user has received.

Parameters

user $account User object:

int $timeframe How many seconds back should be considered:

Return value

int Number of messages/threads

3 calls to _privatemsg_limits_get_received()
privatemsg_limits_form_privatemsg_list_alter in privatemsg_limits/privatemsg_limits.module
Implements hook_form_FORM_ID_alter().
privatemsg_limits_privatemsg_block_message in privatemsg_limits/privatemsg_limits.module
Implements hook_privatemsg_block_message().
privatemsg_limits_privatemsg_message_validate in privatemsg_limits/privatemsg_limits.module
Implements hook_privatemsg_message_validate().

File

privatemsg_limits/privatemsg_limits.module, line 315
Privatemsg Quota module

Code

function _privatemsg_limits_get_received($account) {
  $query = _privatemsg_assemble_query(array(
    'received',
    'privatemsg_limits',
  ), $account);
  return (int) $query
    ->countQuery()
    ->execute()
    ->fetchField();
}