You are here

function sms_valid_ruleset_set_status in SMS Framework 7

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

Sets enabled directions for a ruleset.

Parameters

int $prefix: A prefix number.

int $dir: The direction code that you want to set. See SMS_DIR_* constants.

Return value

bool true on success, false otherwise.

2 calls to sms_valid_ruleset_set_status()
SmsValidWebTest::testSmsValidFunctions in modules/sms_valid/sms_valid.test
Tests the internal sms_valid functions.
sms_valid_admin_rulesets_form_submit in modules/sms_valid/sms_valid.admin.inc
Submit handler for sms_valid_admin_rulesets_form().

File

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

Code

function sms_valid_ruleset_set_status($prefix, $dir = SMS_DIR_ALL) {
  return db_update('sms_valid_rules')
    ->fields(array(
    'dirs_enabled' => $dir,
  ))
    ->condition('prefix', $prefix)
    ->execute();
}