aliroExtConfig Class Reference

List of all members.

Public Member Functions

 __construct ($formalname)
 get ($property)
 delete ($property)
 set ($property, $value)
 update ()

Private Attributes

 $formalname = ''
 $configs = array()
 $remove = array()
 $changed = array()


Detailed Description

Definition at line 41 of file aliroExtConfig.php.


Constructor & Destructor Documentation

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     }


Member Function Documentation

aliroExtConfig::get ( property  ) 

Definition at line 55 of file aliroExtConfig.php.

00055                                     {
00056         return isset($this->configs[$property]) ? $this->configs[$property] : null;
00057     }

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     }


Member Data Documentation

aliroExtConfig::$formalname = '' [private]

Definition at line 42 of file aliroExtConfig.php.

Referenced by __construct().

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.


The documentation for this class was generated from the following file:

Generated on Thu Apr 17 13:03:29 2008 for ALIRO by  doxygen 1.5.5