Changeset 3783

Show
Ignore:
Timestamp:
02/15/08 15:07:47 (17 months ago)
Author:
guilhermeblanco
Message:

Added NOT operator recognition in DQL (fixes #496)

Files:
3 modified

Legend:

Unmodified
Added
Removed
  • branches/0.10/lib/Doctrine/Query/Condition.php

    r3245 r3783  
    6464                $r = implode(' OR ', $ret); 
    6565            } else { 
     66                // Fix for #710 
    6667                if (substr($parts[0],0,1) == '(' && substr($parts[0], -1) == ')') { 
    6768                    return $this->parse(substr($parts[0], 1, -1)); 
    6869                } else { 
    69                     return $this->load($parts[0]); 
     70                    // Processing NOT here 
     71                    if (strtoupper(substr($parts[0], 0, 4)) === 'NOT ') { 
     72                        $r = 'NOT ('.$this->parse(substr($parts[0], 4)).')'; 
     73                    } else { 
     74                        return $this->load($parts[0]); 
     75                    } 
    7076                } 
    7177            } 
  • branches/0.9/lib/Doctrine/Query/Condition.php

    r3032 r3783  
    6464                $r = implode(' OR ', $ret); 
    6565            } else { 
     66                // Fix for #710 
    6667                if (substr($parts[0],0,1) == '(' && substr($parts[0], -1) == ')') { 
    6768                    return $this->parse(substr($parts[0], 1, -1)); 
    6869                } else { 
    69                     return $this->load($parts[0]); 
     70                    // Processing NOT here 
     71                    if (strtoupper(substr($parts[0], 0, 4)) === 'NOT ') { 
     72                        $r = 'NOT ('.$this->parse(substr($parts[0], 4)).')'; 
     73                    } else { 
     74                        return $this->load($parts[0]); 
     75                    } 
    7076                } 
    7177            } 
  • trunk/lib/Doctrine/Query/Condition.php

    r3570 r3783  
    6464                $r = implode(' OR ', $ret); 
    6565            } else { 
     66                // Fix for #710 
    6667                if (substr($parts[0],0,1) == '(' && substr($parts[0], -1) == ')') { 
    6768                    return $this->parse(substr($parts[0], 1, -1)); 
    6869                } else { 
    69                     return $this->load($parts[0]); 
     70                    // Processing NOT here 
     71                    if (strtoupper(substr($parts[0], 0, 4)) === 'NOT ') { 
     72                        $r = 'NOT ('.$this->parse(substr($parts[0], 4)).')'; 
     73                    } else { 
     74                        return $this->load($parts[0]); 
     75                    } 
    7076                } 
    7177            }