root

Changeset 754

Show
Ignore:
Timestamp:
03/03/10 13:53:38 (5 months ago)
Author:
wbond
Message:

Changed fORMDatabase::injectFromAndGroupByClauses() to be able to handle table aliases that contain other aliases inside of them

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • fORMDatabase.php

    r740 r754 Hide Line Numbers
    33 * Holds a single instance of the fDatabase class and provides database manipulation functionality for ORM code 
    44 *  
    5  * @copyright  Copyright (c) 2007-2009 Will Bond, others 
     5 * @copyright  Copyright (c) 2007-2010 Will Bond, others 
    66 * @author     Will Bond [wb] <will@flourishlib.com> 
    77 * @author     Craig Ruksznis, iMarc LLC [cr-imarc] <craigruk@imarc.net> 
     
    1111 * @link       http://flourishlib.com/fORMDatabase 
    1212 *  
    13  * @version    1.0.0b20 
     13 * @version    1.0.0b21 
     14 * @changes    1.0.0b21  Changed ::injectFromAndGroupByClauses() to be able to handle table aliases that contain other aliases inside of them [wb, 2010-03-03] 
    1415 * @changes    1.0.0b20  Fixed a bug where joining to a table two separate ways could cause table alias issues and incorrect SQL to be generated [wb, 2009-12-16] 
    1516 * @changes    1.0.0b19  Added the ability to compare columns with the `=:`, `!:`, `<:`, `<=:`, `>:` and `>=:` operators [wb, 2009-12-08] 
     
    10731074                 
    10741075                foreach ($table_map as $arrow_table => $alias) { 
    1075                     $temp_sql = str_replace($arrow_table, $alias, $temp_sql); 
     1076                    $temp_sql = preg_replace('#(?<![\w"])' . preg_quote($arrow_table, '#') . '(?!=[\w"])#', $alias, $temp_sql); 
    10761077                } 
    10771078                 
     
    12861287 
    12871288/** 
    1288  * Copyright (c) 2007-2009 Will Bond <will@flourishlib.com>, others 
     1289 * Copyright (c) 2007-2010 Will Bond <will@flourishlib.com>, others 
    12891290 *  
    12901291 * Permission is hereby granted, free of charge, to any person obtaining a copy