set() public method

Sets the value for a preference.
public set ( string $pref, string $val )
$pref string The preference name.
$val string The preference value.
Beispiel #1
0
 /**
  * Retrieves the requested preferences scope from the storage backend.
  *
  * @param Horde_Prefs_Scope $scope_ob  The scope object.
  *
  * @return Horde_Prefs_Scope  The modified scope object.
  * @throws Horde_Prefs_Exception
  */
 public function get($scope_ob)
 {
     if ($this->_loadFileCache() && isset($this->_fileCache[$scope_ob->scope])) {
         foreach ($this->_fileCache[$scope_ob->scope] as $name => $val) {
             $scope_ob->set($name, $val);
         }
     }
     return $scope_ob;
 }
Beispiel #2
0
 /**
  * Retrieves the requested preferences scope from the storage backend.
  *
  * @param Horde_Prefs_Scope $scope_ob  The scope object.
  *
  * @return Horde_Prefs_Scope  The modified scope object.
  * @throws Horde_Prefs_Exception
  */
 public function get($scope_ob)
 {
     try {
         $data = $this->_getStorage();
     } catch (Horde_Prefs_Exception $e) {
         $this->_logMissingStorage($e);
         return $scope_ob;
     }
     /** This may not fail (or if it does it is okay to pass the error up */
     $query = $data->getQuery(Horde_Kolab_Storage_Data::QUERY_PREFS);
     try {
         $pref = $query->getApplicationPreferences($scope_ob->scope);
     } catch (Horde_Kolab_Storage_Exception $e) {
         $this->_logMissingScope($e, $scope_ob->scope);
         return $scope_ob;
     }
     foreach ($this->_prefToArray($pref['pref']) as $key => $value) {
         $scope_ob->set($key, $value);
     }
     return $scope_ob;
 }