You are here

function sms_valid_get_ruleset in SMS Framework 6

Same name and namespace in other branches
  1. 6.2 modules/sms_valid/sms_valid.module \sms_valid_get_ruleset()
  2. 7 modules/sms_valid/sms_valid.module \sms_valid_get_ruleset()

Get a ruleset for a given prefix

Parameters

$prefix: A numberic prefix.

Return value

A ruleset array or FALSE.

4 calls to sms_valid_get_ruleset()
sms_valid_admin_ruleset_form in modules/sms_valid/sms_valid.admin.inc
Validation ruleset editing form
sms_valid_get_rules in modules/sms_valid/sms_valid.module
Get the rules for a prefix
sms_valid_save_ruleset in modules/sms_valid/sms_valid.module
Create or update a ruleset
sms_valid_validate in modules/sms_valid/sms_valid.module
Validate a number

File

modules/sms_valid/sms_valid.module, line 162
Number validation feature module for Drupal SMS Framework.

Code

function sms_valid_get_ruleset($prefix) {
  $result = db_query("SELECT * FROM {sms_valid_rules} WHERE prefix = %d LIMIT 1", $prefix);
  if (db_affected_rows()) {
    $ruleset = db_fetch_array($result);
    $ruleset['rules'] = unserialize($ruleset['rules']);
    return $ruleset;
  }
  return FALSE;
}