You are here

function sms_valid_get_ruleset in SMS Framework 7

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

Gets a ruleset for a given prefix.

Parameters

int $prefix: A numeric prefix.

Return value

array|false A ruleset array or false if not found.

7 calls to sms_valid_get_ruleset()
SmsValidWebTest::testCrudSmsValidRulesets in modules/sms_valid/sms_valid.test
Tests the creation, update and deletion of sms_valid rulesets.
SmsValidWebTest::testSmsValidFunctions in modules/sms_valid/sms_valid.test
Tests the internal sms_valid functions.
SmsValidWebTest::testSmsValidSettingsForm in modules/sms_valid/sms_valid.test
Tests the application of the sms_valid settings form and settings.
sms_valid_admin_ruleset_form in modules/sms_valid/sms_valid.admin.inc
Form constructor for validation ruleset editing.
sms_valid_get_rules in modules/sms_valid/sms_valid.module
Gets the rules for a specified prefix.

... See full list

File

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

Code

function sms_valid_get_ruleset($prefix) {
  $ruleset = db_query_range("SELECT * FROM {sms_valid_rules} WHERE prefix = :prefix", 0, 1, array(
    ':prefix' => $prefix,
  ))
    ->fetchAssoc();
  if ($ruleset) {
    $ruleset['rules'] = unserialize($ruleset['rules']);
    return $ruleset;
  }
  return FALSE;
}