function sms_valid_get_all_rulesets in SMS Framework 7
Same name and namespace in other branches
- 6.2 modules/sms_valid/sms_valid.module \sms_valid_get_all_rulesets()
- 6 modules/sms_valid/sms_valid.module \sms_valid_get_all_rulesets()
Gets all rulesets.
Return value
array Array of rulesets keyed by prefix.
3 calls to sms_valid_get_all_rulesets()
- SmsValidWebTest::testSmsValidFunctions in modules/
sms_valid/ sms_valid.test - Tests the internal sms_valid functions.
- sms_valid_admin_rulesets_form in modules/
sms_valid/ sms_valid.admin.inc - Form constructor for validation rulesets list form.
- sms_valid_get_rulesets_for_form in modules/
sms_valid/ sms_valid.module - Gets country codes for form options.
File
- modules/
sms_valid/ sms_valid.module, line 127 - Number validation feature module for Drupal SMS Framework.
Code
function sms_valid_get_all_rulesets() {
$result = db_query("SELECT * FROM {sms_valid_rules}");
$rulesets = array();
foreach ($result as $row) {
$prefix = $row->prefix;
$rulesets[$prefix] = $row;
$rulesets[$prefix]->rules = unserialize($row->rules);
}
return $rulesets;
}