public function add($column, $operator, $value, $conjunction = 'AND')
    {
        if (!in_array($operator, self::$arithmeticOperator)) {
            throw new InvalidArgumentException('Invalid arithmetic operator (allowed: ' . implode(', ', self::$arithmeticOperator) . ')');
        }

        if (!in_array($conjunction, self::$logicOperator)) {
            throw new InvalidArgumentException('Invalid logic operator (allowed: ' . implode(', ', self::$logicOperator) . ')');
        }

        if ($operator == 'IN' && is_array($value)) {
            $expr = new Condition\In($column, $value, $conjunction);
        } elseif (($operator == '=' || $operator == 'IS') && $value === null) {
            $expr = new Condition\Nil($column, $conjunction);
        } elseif (($operator == '!=' || $operator == 'IS NOT') && $value === null) {
            $expr = new Condition\NotNil($column, $conjunction);
        } else {
            $expr = new Condition\Basic($column, $operator, $value, $conjunction);
        }

        return $this->addExpression($expr);
    }
public function add($column, $operator, $value, $conjunction = 'AND')
    {
        if (!in_array($operator, self::$arithmeticOperator)) {
            throw new InvalidArgumentException('Invalid arithmetic operator (allowed: ' . implode(', ', self::$arithmeticOperator) . ')');
        }

        if (!in_array($conjunction, self::$logicOperator)) {
            throw new InvalidArgumentException('Invalid logic operator (allowed: ' . implode(', ', self::$logicOperator) . ')');
        }

        if ($operator == 'IN' && is_array($value)) {
            $expr = new Condition\In($column, $value, $conjunction);
        } elseif (($operator == '=' || $operator == 'IS') && $value === null) {
            $expr = new Condition\Nil($column, $conjunction);
        } elseif (($operator == '!=' || $operator == 'IS NOT') && $value === null) {
            $expr = new Condition\NotNil($column, $conjunction);
        } else {
            $expr = new Condition\Basic($column, $operator, $value, $conjunction);
        }

        return $this->addExpression($expr);
    }
public function add ( $ column , $ operator , $ value , $ conjunction = 'AND' ) { if ( ! in_array ( $ operator , self :: $ arithmeticOperator ) ) { throw new InvalidArgumentException ( 'Invalid arithmetic operator (allowed: ' . implode ( ', ' , self :: $ arithmeticOperator ) . ')' ) ; } if ( ! in_array ( $ conjunction , self :: $ logicOperator ) ) { throw new InvalidArgumentException ( 'Invalid logic operator (allowed: ' . implode ( ', ' , self :: $ logicOperator ) . ')' ) ; } if ( $ operator == 'IN' && is_array ( $ value ) ) { $ expr = new Condition \ In ( $ column , $ value , $ conjunction ) ; } elseif ( ( $ operator == '=' || $ operator == 'IS' ) && $ value === null ) { $ expr = new Condition \ Nil ( $ column , $ conjunction ) ; } elseif ( ( $ operator == '!=' || $ operator == 'IS NOT' ) && $ value === null ) { $ expr = new Condition \ NotNil ( $ column , $ conjunction ) ; } else { $ expr = new Condition \ Basic ( $ column , $ operator , $ value , $ conjunction ) ; } return $ this -> addExpression ( $ expr ) ; }
Adds a condition and tries to detect the type of the condition based on
the provided values. It is recommended to use an explicit method

@param string $column
@param string $operator
@param mixed $value
@param string $conjunction
@return \PSX\Sql\Condition
Adds a condition and tries to detect the type of the condition based on the provided values . It is recommended to use an explicit method