library/database/class.sqldriver.php
protected function _ParseExpr($Expr, $Name = NULL, $EscapeExpr = FALSE) {
      $Result = '';
      
      $C = substr($Expr, 0, 1);
      
      if($C === '=' && $EscapeExpr === FALSE) {
         // This is a function call. Each parameter has to be parsed.
         $FunctionArray = preg_split('/(\[[^\]]+\])/', substr($Expr, 1), -1, PREG_SPLIT_DELIM_CAPTURE);
         for($i = 0; $i < count($FunctionArray); $i++) {
            $Part = $FunctionArray[$i];
            if(substr($Part, 1) == '[') {
               // Translate the part of the function call.
               $Part = $this->_FieldExpr(substr($Part, 1, strlen($Part) - 2), $Name);
               $FunctionArray[$i] = $Part;
            }
         }
         // Combine the array back to the original function call.
         $Result = join($FunctionArray);
      } elseif($C === '@' && $EscapeExpr === FALSE) {
         // This is a literal. Don't do anything.
         $Result = substr($Expr, 1);
      } else {
         // This is a column reference.
         if(is_null($Name)) {
            $Result = $this->EscapeIdentifier($Expr);
         } else {
            // This is a named parameter.
            
            // Check to see if the named parameter is valid.
            if(in_array(substr($Expr, 0, 1), array('=', '@'))) {
               // The parameter has to be a default name.
               $Result = $this->NamedParameter('Param', TRUE);
            } else {
               $Result = $this->NamedParameter($Name, TRUE);
            }
            $this->_NamedParameters[$Result] = $Expr;
         }
      }
   
      return $Result;
   }
protected function _ParseExpr($Expr, $Name = NULL, $EscapeExpr = FALSE) {
      $Result = '';
      
      $C = substr($Expr, 0, 1);
      
      if($C === '=' && $EscapeExpr === FALSE) {
         // This is a function call. Each parameter has to be parsed.
         $FunctionArray = preg_split('/(\[[^\]]+\])/', substr($Expr, 1), -1, PREG_SPLIT_DELIM_CAPTURE);
         for($i = 0; $i < count($FunctionArray); $i++) {
            $Part = $FunctionArray[$i];
            if(substr($Part, 1) == '[') {
               // Translate the part of the function call.
               $Part = $this->_FieldExpr(substr($Part, 1, strlen($Part) - 2), $Name);
               $FunctionArray[$i] = $Part;
            }
         }
         // Combine the array back to the original function call.
         $Result = join($FunctionArray);
      } elseif($C === '@' && $EscapeExpr === FALSE) {
         // This is a literal. Don't do anything.
         $Result = substr($Expr, 1);
      } else {
         // This is a column reference.
         if(is_null($Name)) {
            $Result = $this->EscapeIdentifier($Expr);
         } else {
            // This is a named parameter.
            
            // Check to see if the named parameter is valid.
            if(in_array(substr($Expr, 0, 1), array('=', '@'))) {
               // The parameter has to be a default name.
               $Result = $this->NamedParameter('Param', TRUE);
            } else {
               $Result = $this->NamedParameter($Name, TRUE);
            }
            $this->_NamedParameters[$Result] = $Expr;
         }
      }
   
      return $Result;
   }
protected function _ParseExpr ( $ Expr , $ Name = NULL , $ EscapeExpr = FALSE ) { $ Result = '' ; $ C = substr ( $ Expr , 0 , 1 ) ; if ( $ C === '=' && $ EscapeExpr === FALSE ) { // This is a function call. Each parameter has to be parsed. $ FunctionArray = preg_split ( '/(\[[^\]]+\])/' , substr ( $ Expr , 1 ) , - 1 , PREG_SPLIT_DELIM_CAPTURE ) ; for ( $ i = 0 ; $ i < count ( $ FunctionArray ) ; $ i ++ ) { $ Part = $ FunctionArray [ $ i ] ; if ( substr ( $ Part , 1 ) == '[' ) { // Translate the part of the function call. $ Part = $ this -> _FieldExpr ( substr ( $ Part , 1 , strlen ( $ Part ) - 2 ) , $ Name ) ; $ FunctionArray [ $ i ] = $ Part ; } } // Combine the array back to the original function call. $ Result = join ( $ FunctionArray ) ; } elseif ( $ C === '@' && $ EscapeExpr === FALSE ) { // This is a literal. Don't do anything. $ Result = substr ( $ Expr , 1 ) ; } else { // This is a column reference. if ( is_null ( $ Name ) ) { $ Result = $ this -> EscapeIdentifier ( $ Expr ) ; } else { // This is a named parameter. // Check to see if the named parameter is valid. if ( in_array ( substr ( $ Expr , 0 , 1 ) , array ( '=' , '@' ) ) ) { // The parameter has to be a default name. $ Result = $ this -> NamedParameter ( 'Param' , TRUE ) ; } else { $ Result = $ this -> NamedParameter ( $ Name , TRUE ) ; } $ this -> _NamedParameters [ $ Result ] = $ Expr ; } } return $ Result ; }
Parses an expression for use in where clauses.

@param string $Expr The expression to parse.
@param string $Name A name to give the parameter if $Expr becomes a named parameter.
@return string The parsed expression.
Parses an expression for use in where clauses .