Changeset 6051

Show
Ignore:
Timestamp:
05/25/07 12:38:02 (2 years ago)
Author:
rambo
Message:

UNTESTED text aliases for some operators

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • trunk/src/org.openpsa.products/handler/product/search.php

    r5391 r6051  
    4040        { 
    4141            case '<': 
     42            case 'lt': 
    4243            case '<=': 
     44            case 'lte': 
    4345            case '=': 
     46            case 'eq': 
    4447            case '<>': 
     48            case '!eq': 
    4549            case '>=': 
     50            case 'gte': 
    4651            case '>': 
     52            case 'gt': 
    4753            case 'LIKE': 
     54            case 'NOT LIKE': 
    4855                return true; 
    4956            default: 
     
    5259    } 
    5360 
     61    function _normalize_operator($operator) 
     62    { 
     63        switch ($operator) 
     64        { 
     65            case 'lt': 
     66                return '<'; 
     67            case 'gt': 
     68                return '>'; 
     69            case 'lte': 
     70                return '<='; 
     71            case 'gte': 
     72                return '>='; 
     73            case '!eq': 
     74                return '<>'; 
     75            case 'eq': 
     76                return '='; 
     77            default: 
     78                return $operator; 
     79        } 
     80    } 
     81 
    5482    /** 
    5583     * Check each search constraint for validity and normalize 
     
    84112                continue; 
    85113            } 
     114             
     115            $constraint['constraint'] = $this->_normalize_operator($constraint['constraint']); 
    86116 
    87117            if (   !array_key_exists('value', $constraint)