/**
  * This method stores a persistent object in the database
  *
  * @param integer $userId
  * @param string $name
  * @param array $value
  */
 public static function set($userId, $name, $value)
 {
     $lVar = self::retrieveByUserIdAndName($name, $userId);
     if (!$lVar) {
         $lVar = new PersistentObject();
     }
     $lVar->setName($name);
     $lVar->setUserId($userId);
     $lVar->setValue(serialize($value));
     $lVar->save();
     return $lVar;
 }