function RulesConditionContainer::condition

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 2612

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;
}