Public Member Functions | |
| __construct ($formalname) | |
| get ($property) | |
| delete ($property) | |
| set ($property, $value) | |
| update () | |
Private Attributes | |
| $formalname = '' | |
| $configs = array() | |
| $remove = array() | |
| $changed = array() | |
Definition at line 41 of file aliroExtConfig.php.
| aliroExtConfig::__construct | ( | $ | formalname | ) |
Definition at line 47 of file aliroExtConfig.php.
References $formalname, and aliroDatabase::getInstance().
00047 { 00048 $this->formalname = $formalname; 00049 $database = aliroDatabase::getInstance(); 00050 $database->setQuery("SELECT property, value FROM #__configurations WHERE system='Aliro' AND component='$formalname'"); 00051 $results = $database->loadObjectList(); 00052 if ($results) foreach ($results as $result) $this->configs[$result->property] = $result->value; 00053 }
| aliroExtConfig::get | ( | $ | property | ) |
| aliroExtConfig::delete | ( | $ | property | ) |
Definition at line 59 of file aliroExtConfig.php.
00059 { 00060 if (isset($this->configs[$property])) unset ($this->configs[$property]); 00061 $this->remove[$property] = 1; 00062 }
| aliroExtConfig::set | ( | $ | property, | |
| $ | value | |||
| ) |
Definition at line 64 of file aliroExtConfig.php.
00064 { 00065 $this->configs[$property] = $value; 00066 if (isset($this->remove[$property])) unset ($this->remove[$property]); 00067 $this->changed[$property] = 1; 00068 }
| aliroExtConfig::update | ( | ) |
Definition at line 70 of file aliroExtConfig.php.
References aliroDatabase::getInstance().
00070 { 00071 $database = aliroDatabase::getInstance(); 00072 if (count($this->remove)) { 00073 $deletelist = "'".implode ("','", $this->remove)."'"; 00074 $database->doSQL("DELETE FROM #__configurations WHERE system='Aliro' AND component='$this->formalname' AND property IN ($deletelist)"); 00075 } 00076 if (count($this->changed)) { 00077 foreach (array_keys($this->changed) as $property) $setitem[] = " WHEN property = '$property' THEN '{$this->configs[$property]}'"; 00078 $changelist = implode("\n", $setitem); 00079 $database->doSQL("UPDATE #__configurations SET value = CASE $changelist END WHERE system = 'Aliro' AND component='$this->formalname'"); 00080 } 00081 00082 }
aliroExtConfig::$formalname = '' [private] |
aliroExtConfig::$configs = array() [private] |
Definition at line 43 of file aliroExtConfig.php.
aliroExtConfig::$remove = array() [private] |
Definition at line 44 of file aliroExtConfig.php.
aliroExtConfig::$changed = array() [private] |
Definition at line 45 of file aliroExtConfig.php.
1.5.5