Ignore:
Timestamp:
2011/12/26 17:11:08 (15 years ago)
Author:
Seasoft
Message:

#1582 (SC_Query 一致レコードの有無を返す機能を追加 (パフォーマンス改善))
#1526 (typo修正・ソース整形・ソースコメントの改善)
#1449 (不要な関数・処理の整理)

File:
1 edited

Legend:

Unmodified
Added
Removed
  • branches/version-2_11-dev/data/class/helper/SC_Helper_Customer.php

    r21221 r21376  
    276276     */ 
    277277    function sfGetUniqSecretKey() { 
    278         $objQuery   =& SC_Query_Ex::getSingletonInstance(); 
    279         $count      = 1; 
    280         while ($count != 0) { 
     278        $objQuery =& SC_Query_Ex::getSingletonInstance(); 
     279 
     280        do { 
    281281            $uniqid = SC_Utils_Ex::sfGetUniqRandomId('r'); 
    282             $count  = $objQuery->count("dtb_customer", "secret_key = ?", array($uniqid)); 
    283         } 
     282            $exists = $objQuery->exists("dtb_customer", "secret_key = ?", array($uniqid)); 
     283        } while ($exists); 
    284284        return $uniqid; 
    285285    } 
Note: See TracChangeset for help on using the changeset viewer.