You are here

class rules_data_type_boolean in Rules 6

Rules boolean data type

Hierarchy

Expanded class hierarchy of rules_data_type_boolean

Related topics

1 string reference to 'rules_data_type_boolean'
rules_rules_data_type_info in rules/modules/rules.rules.inc
Implementation of hook_rules_data_type_info().

File

rules/modules/rules.rules.inc, line 118
rules integration for the rules module

View source
class rules_data_type_boolean extends rules_data_type_string {
  function check_value($info, $value) {
    return (bool) $value;
  }
  function get_default_input_form($info, $value, &$form_state) {
    $info += array(
      'long' => FALSE,
      'required' => TRUE,
      'description' => '',
    );
    $info['description'] = $info['description'] . ' ' . t('Just enter 1 for TRUE, 0 for FALSE or make use of an input evaluator.');
    return array(
      '#type' => $info['long'] ? 'textarea' : 'textfield',
      '#title' => $info['label'],
      '#description' => $info['description'],
      '#required' => $info['required'],
      '#default_value' => $value,
    );
  }

}

Members

Namesort descending Modifiers Type Description Overrides
rules_data_type::$type property
rules_data_type::$_data property
rules_data_type::$_info property
rules_data_type::construct function Constructor
rules_data_type::eval_input function Returns whether the input evaluator should be used for this data
rules_data_type::get function Gets the data
rules_data_type::get_identifier function Gets the identifier of this data, which can be of every php data type - even an array. Implement it, if your data type is identifiable. 5
rules_data_type::get_info function Gets the information about this data type.
rules_data_type::init function Inititate the data
rules_data_type::is_identifiable function Returns whether this data is identifiable
rules_data_type::is_savable function Returns whether this data is savable
rules_data_type::load function Loads the data identified with an identifier as returned by get_identifier(). Just return the data or FALSE if loading the data failed. 5
rules_data_type::save function Makes changes to the data permanent. Implement it, if your data type is savable. 1
rules_data_type::update function Replaces the data with the new one
rules_data_type::uses_input_form function Returns whether this data makes use of an input form for creating an instance on the fly.
rules_data_type_boolean::check_value function Checks the value of your data type. E.g. the number data type uses this to make sure the value is a number. Overrides rules_data_type::check_value
rules_data_type_boolean::get_default_input_form function Gets the input form for the data Implement it, if your data is not identifiable. Overrides rules_data_type_string::get_default_input_form