You are here

public function FlagRulesDataWrapper::validate in Flag 7.3

Same name and namespace in other branches
  1. 7.2 flag.rules.inc \FlagRulesDataWrapper::validate()

Returns whether $value is a valid value to set.

Overrides EntityMetadataWrapper::validate

File

./flag.rules.inc, line 47
Rules integration for the Flag module.

Class

FlagRulesDataWrapper
A custom wrapper class for flags to be used with Rules.

Code

public function validate($value) {
  if (isset($value) && is_string($value)) {
    return TRUE;
  }
  elseif (isset($value) && is_object($value) && $value instanceof flag_flag) {
    return TRUE;
  }
  return parent::validate($value);
}