You are here

public function RulesConditionalPredicateElement::__construct in Conditional Rules 7

Same name and namespace in other branches
  1. 8 includes/rules_conditional.core.inc \RulesConditionalPredicateElement::__construct()

Overrides RulesActionContainer::__construct

File

includes/rules_conditional.core.inc, line 402
Conditional Rules framework implementation.

Class

RulesConditionalPredicateElement
Base conditional element that uses a predicate.

Code

public function __construct($predicate = NULL, $settings = array()) {
  parent::__construct();
  if (isset($predicate)) {
    $predicate = is_object($predicate) && $predicate instanceof RulesConditionInterface ? $predicate : rules_condition($predicate, $settings);
    $this
      ->setPredicate($predicate);
  }
}