You are here

public function RulesConditionContainer::condition in Rules 7.2

Adds a condition to the container.

Pass in either an instance of the RulesConditionInterface or the arguments as needed by rules_condition().

Return value

$this

File

includes/rules.core.inc, line 2592
Rules base classes and interfaces needed for any rule evaluation.

Class

RulesConditionContainer
Base class for all condition containers.

Code

public function condition($name, $settings = array()) {
  $condition = is_object($name) && $name instanceof RulesConditionInterface ? $name : rules_condition($name, $settings);
  $condition
    ->setParent($this);
  return $this;
}