mirror of
https://github.com/EGroupware/egroupware.git
synced 2024-11-08 17:14:36 +01:00
Simple caching of name2id and id2name values.
This commit is contained in:
parent
b063c002ca
commit
076bb37660
@ -241,11 +241,18 @@
|
||||
function name2id($account_lid)
|
||||
{
|
||||
global $phpgw, $phpgw_info;
|
||||
static $name_list;
|
||||
|
||||
if($name_list[$account_lid])
|
||||
{
|
||||
return $name_list[$account_lid];
|
||||
}
|
||||
|
||||
$this->db->query("SELECT account_id FROM phpgw_accounts WHERE account_lid='".$account_lid."'",__LINE__,__FILE__);
|
||||
if($this->db->num_rows())
|
||||
{
|
||||
$this->db->next_record();
|
||||
$name_list[$account_lid] = $this->db->f('account_id');
|
||||
return intval($this->db->f('account_id'));
|
||||
}
|
||||
else
|
||||
@ -257,11 +264,18 @@
|
||||
function id2name($account_id)
|
||||
{
|
||||
global $phpgw, $phpgw_info;
|
||||
static $id_list;
|
||||
|
||||
if($id_list[$account_id])
|
||||
{
|
||||
return $id_list[$account_id];
|
||||
}
|
||||
|
||||
$this->db->query("SELECT account_lid FROM phpgw_accounts WHERE account_id='".$account_id."'",__LINE__,__FILE__);
|
||||
if($this->db->num_rows())
|
||||
{
|
||||
$this->db->next_record();
|
||||
$id_list[$account_id] = $this->db->f('account_lid');
|
||||
return $this->db->f('account_lid');
|
||||
}
|
||||
else
|
||||
|
@ -161,11 +161,18 @@
|
||||
function name2id($account_lid)
|
||||
{
|
||||
global $phpgw, $phpgw_info;
|
||||
static $name_list;
|
||||
|
||||
if($name_list[$account_lid])
|
||||
{
|
||||
return $name_list[$account_lid];
|
||||
}
|
||||
|
||||
$this->db->query("SELECT account_id FROM phpgw_accounts WHERE account_lid='".$account_lid."'",__LINE__,__FILE__);
|
||||
if($this->db->num_rows())
|
||||
{
|
||||
$this->db->next_record();
|
||||
$name_list[$account_lid] = $this->db->f('account_id');
|
||||
return $this->db->f('account_id');
|
||||
}
|
||||
else
|
||||
@ -177,11 +184,18 @@
|
||||
function id2name($account_id)
|
||||
{
|
||||
global $phpgw, $phpgw_info;
|
||||
static $id_list;
|
||||
|
||||
if($id_list[$account_id])
|
||||
{
|
||||
return $id_list[$account_id];
|
||||
}
|
||||
|
||||
$this->db->query("SELECT account_lid FROM phpgw_accounts WHERE account_id='".$account_id."'",__LINE__,__FILE__);
|
||||
if($this->db->num_rows())
|
||||
{
|
||||
$this->db->next_record();
|
||||
$id_list[$account_id] = $this->db->f('account_lid');
|
||||
return $this->db->f('account_lid');
|
||||
}
|
||||
else
|
||||
|
@ -192,11 +192,18 @@
|
||||
function name2id($account_lid)
|
||||
{
|
||||
global $phpgw, $phpgw_info;
|
||||
static $name_list;
|
||||
|
||||
if($name_list[$account_lid])
|
||||
{
|
||||
return $name_list[$account_lid];
|
||||
}
|
||||
|
||||
$this->db->query("SELECT account_id FROM phpgw_accounts WHERE account_lid='".$account_lid."'",__LINE__,__FILE__);
|
||||
if($this->db->num_rows())
|
||||
{
|
||||
$this->db->next_record();
|
||||
$name_list[$account_lid] = $this->db->f('account_id');
|
||||
return $this->db->f('account_id');
|
||||
}
|
||||
else
|
||||
@ -208,11 +215,18 @@
|
||||
function id2name($account_id)
|
||||
{
|
||||
global $phpgw, $phpgw_info;
|
||||
static $id_list;
|
||||
|
||||
if($id_list[$account_id])
|
||||
{
|
||||
return $id_list[$account_id];
|
||||
}
|
||||
|
||||
$this->db->query("SELECT account_lid FROM phpgw_accounts WHERE account_id='".$account_id."'",__LINE__,__FILE__);
|
||||
if($this->db->num_rows())
|
||||
{
|
||||
$this->db->next_record();
|
||||
$id_list[$account_id] = $this->db->f('account_lid');
|
||||
return $this->db->f('account_lid');
|
||||
}
|
||||
else
|
||||
|
Loading…
Reference in New Issue
Block a user