Filter/Condition/ConditionNode.php
public function setCondition($name, ConditionInterface $condition)
    {
        if (array_key_exists($name, $this->fields)) {
            $this->fields[$name] = $condition;

            return true;
        }

        $i = 0;
        $end = count($this->children);
        $set = false;

        while ($i < $end && !$set) {
            $set = $this->children[$i]->setCondition($name, $condition);
            $i++;
        }

        return $set;
    }
public function setCondition($name, ConditionInterface $condition)
    {
        if (array_key_exists($name, $this->fields)) {
            $this->fields[$name] = $condition;

            return true;
        }

        $i = 0;
        $end = count($this->children);
        $set = false;

        while ($i < $end && !$set) {
            $set = $this->children[$i]->setCondition($name, $condition);
            $i++;
        }

        return $set;
    }
public function setCondition ( $ name , ConditionInterface $ condition ) { if ( array_key_exists ( $ name , $ this -> fields ) ) { $ this -> fields [ $ name ] = $ condition ; return true ; } $ i = 0 ; $ end = count ( $ this -> children ) ; $ set = false ; while ( $ i < $ end && ! $ set ) { $ set = $ this -> children [ $ i ] -> setCondition ( $ name , $ condition ) ; $ i ++ ; } return $ set ; }
Set the condition for the given field name.

@param string             $name
@param ConditionInterface $condition
@return bool
Set the condition for the given field name .