[Vtigercrm-commits] [vtiger-commits] r5366 - /vtigercrm/branches/4.2/include/utils.php
vtigercrm-commits at vtiger.fosslabs.com
vtigercrm-commits at vtiger.fosslabs.com
Tue Apr 25 17:10:47 EDT 2006
Author: allanbush
Date: Tue Apr 25 15:10:44 2006
New Revision: 5366
Log:
Cached requests for user id. Refs #744.
Modified:
vtigercrm/branches/4.2/include/utils.php
Modified: vtigercrm/branches/4.2/include/utils.php
==============================================================================
--- vtigercrm/branches/4.2/include/utils.php (original)
+++ vtigercrm/branches/4.2/include/utils.php Tue Apr 25 15:10:44 2006
@@ -4034,11 +4034,15 @@
function getUserId($record)
{
+ static $cache = array();
+ if(isset($cache[$record])) return $cache[$record];
+
global $vtlog;
$vtlog->logthis("in getUserId ".$record,'info');
global $adb;
- $user_id=$adb->query_result($adb->query("select * from crmentity where crmid = ".$record),0,'smownerid');
+ $user_id=$adb->query_result($adb->query("select smownerid from crmentity where crmid = ".$record),0,'smownerid');
+ $cache[$record] = $user_id;
return $user_id;
}
More information about the vtigercrm-commits
mailing list