public function where($property, $constraint = null, $value = null, $condition = 'AND')
    {
        if (!empty($property)) {
            $where = array();
            $where['property'] = $property;

            if (isset($constraint)) {
                $constraint = strtoupper($constraint);
                $condition  = strtoupper($condition);

                $where['constraint'] = $constraint;
                $where['value']      = $value;
            }

            $where['condition']  = count($this->where) ? $condition : '';

            //Make sure we don't store the same where clauses twice
            $signature = md5($property.$constraint.$value);
            if (!isset($this->where[$signature])) {
                $this->where[$signature] = $where;
            }
        }

        return $this;
    }
public function where($property, $constraint = null, $value = null, $condition = 'AND')
    {
        if (!empty($property)) {
            $where = array();
            $where['property'] = $property;

            if (isset($constraint)) {
                $constraint = strtoupper($constraint);
                $condition  = strtoupper($condition);

                $where['constraint'] = $constraint;
                $where['value']      = $value;
            }

            $where['condition']  = count($this->where) ? $condition : '';

            //Make sure we don't store the same where clauses twice
            $signature = md5($property.$constraint.$value);
            if (!isset($this->where[$signature])) {
                $this->where[$signature] = $where;
            }
        }

        return $this;
    }
public function where ( $ property , $ constraint = null , $ value = null , $ condition = 'AND' ) { if ( ! empty ( $ property ) ) { $ where = array ( ) ; $ where [ 'property' ] = $ property ; if ( isset ( $ constraint ) ) { $ constraint = strtoupper ( $ constraint ) ; $ condition = strtoupper ( $ condition ) ; $ where [ 'constraint' ] = $ constraint ; $ where [ 'value' ] = $ value ; } $ where [ 'condition' ] = count ( $ this -> where ) ? $ condition : '' ; //Make sure we don't store the same where clauses twice $ signature = md5 ( $ property . $ constraint . $ value ) ; if ( ! isset ( $ this -> where [ $ signature ] ) ) { $ this -> where [ $ signature ] = $ where ; } } return $ this ; }
Built the where clause of the query

@param   string          The name of the property the constraint applies too, or a SQL function or statement
@param   string          The comparison used for the constraint
@param   string|array    The value compared to the property value using the constraint
@param   string          The where condition, defaults to 'AND'
@return  AnDatabaseQuery
Built the where clause of the query