You are here

public function EntityMetadataWrapperNumberBoolean::validate in Boolean Field 7

Returns whether $value is a valid value to set.

Overrides EntityMetadataWrapper::validate

File

./boolean.rules.inc, line 59
Provides integration with Rules module.

Class

EntityMetadataWrapperNumberBoolean
An entity wrapper class for boolean data.

Code

public function validate($value) {
  $states = boolean_value_info();
  return is_numeric($value) && in_array($value, array_keys($states));
}