class RulesConditionalTestStubElement in Conditional Rules 8
Same name and namespace in other branches
- 7 tests/rules_conditional_test.inc \RulesConditionalTestStubElement
Test element.
Hierarchy
- class \RulesConditionalElement extends \RulesActionContainer implements \RulesActionInterface
Expanded class hierarchy of RulesConditionalTestStubElement
1 string reference to 'RulesConditionalTestStubElement'
- rules_conditional_test_rules_plugin_info in tests/
rules_conditional_test.module - Implements hook_rules_plugin_info().
File
- tests/
rules_conditional_test.inc, line 54 - Testing implementations.
View source
class RulesConditionalTestStubElement extends RulesConditionalElement {
protected $itemName = 'stub conditional element';
protected $pass;
public function __construct($pass = TRUE) {
parent::__construct();
$this
->setPass($pass);
}
/**
* Sets whether the element should pass.
*/
public function setPass($pass) {
$this->pass = $pass;
}
/**
* Determines whether this branch can be evaluated.
*/
public function canEvaluate(RulesState $state) {
return $this->pass;
}
}