You are here

function role_expire_get_expired in Role Expire 7

Same name and namespace in other branches
  1. 6 role_expire.module \role_expire_get_expired()

API function; Get all records that should be expired.

Parameters

$time: Optional. The time to check, if not set it will check current time.

1 call to role_expire_get_expired()
role_expire_cron in ./role_expire.module
Implements hook_cron().

File

./role_expire.module, line 199
Role Expire module

Code

function role_expire_get_expired($time = '') {
  $return = array();
  if (!$time) {
    $time = REQUEST_TIME;
  }
  $result = db_query("SELECT rid, uid, expiry_timestamp FROM {role_expire} WHERE expiry_timestamp <= :expiry_timestamp", array(
    ':expiry_timestamp' => $time,
  ));
  foreach ($result as $row) {
    $return[] = $row;
  }
  return $return;
}