当前位置: 首页>>代码示例>>PHP>>正文


PHP Setting::setName方法代码示例

本文整理汇总了PHP中Setting::setName方法的典型用法代码示例。如果您正苦于以下问题:PHP Setting::setName方法的具体用法?PHP Setting::setName怎么用?PHP Setting::setName使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在Setting的用法示例。


在下文中一共展示了Setting::setName方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: setValue

 /**
  * Sets value for given key name
  *
  * @param string $name
  * @param mixed $value
  * 
  */
 public static function setValue($name, $value)
 {
     $c = new Criteria();
     $c->add(SettingPeer::NAME, $name);
     if (!($setting = SettingPeer::doSelectOne($c))) {
         $setting = new Setting();
         $setting->setName($name);
     }
     $setting->setValue($value);
     $setting->save();
 }
开发者ID:royalterra,项目名称:pdns-gui,代码行数:18,代码来源:SettingPeer.php

示例2: convertSurveySettings

                     $user->setLanguages($this->suid, $m, $survey->getAllowedLanguages($m));
                 }
                 $user->saveChanges();
             }
         }
     }
 }
 function convertSurveySettings($row)
 {
     $query = "replace into " . Config::dbSurvey() . "_surveys (suid, name, description) values (";
     $query .= prepareDatabaseString($this->suid) . ",";
     $query .= "'" . prepareDatabaseString($row["header"]) . "',";
     $query .= "'')";
     $this->db->executeQuery($query);
     $query = "replace into " . Config::dbSurvey() . "_versions (suid, vnid, name, description) values (";
     $query .= prepareDatabaseString($this->suid) . ",";
     $query .= prepareDatabaseString(1) . ",";
     $query .= "'Current',";
     $query .= "'Current version')";
     $this->db->executeQuery($query);
     /* add default survey */
     $setting = new Setting();
     $setting->setSuid($this->suid);
     $setting->setObject(USCIC_SURVEY);
     $setting->setObjectType(OBJECT_SURVEY);
     $setting->setName(SETTING_DEFAULT_SURVEY);
     $setting->setValue($this->suid);
     $setting->setMode(MODE_CASI);
     // dummy
     $setting->setLanguage(1);
     // dummy
     $setting->save();
     /* add default mode */
     $setting = new Setting();
     $setting->setSuid($this->suid);
     $setting->setObject(USCIC_SURVEY);
     $setting->setObjectType(OBJECT_SURVEY);
     $setting->setName(SETTING_DEFAULT_MODE);
     $setting->setMode(MODE_CASI);
     $setting->setLanguage(1);
     // dummy
     $setting->setValue(MODE_CASI);
     $setting->save();
     /* add default language */
     $setting = new Setting();
     $setting->setSuid($this->suid);
     $setting->setObject(USCIC_SURVEY);
     $setting->setObjectType(OBJECT_SURVEY);
     $setting->setName(SETTING_DEFAULT_LANGUAGE);
开发者ID:nubissurveying,项目名称:nubis,代码行数:49,代码来源:importer.php

示例3: elseif

        fMessaging::create('error', fURL::get(), $e->getMessage());
    }
    include VIEW_PATH . '/add_edit_setting.php';
    // --------------------------------- //
} elseif ('add' == $action) {
    $setting = new Setting();
    if ('user' == $setting_type) {
        $list_plugin_settings = $plugin_user_settings;
    } else {
        $list_plugin_settings = $plugin_settings;
    }
    if (!array_key_exists($setting_name, $list_plugin_settings)) {
        $setting_name = '';
    }
    $setting->setFriendlyName($list_plugin_settings[$setting_name]['friendly_name']);
    $setting->setName($setting_name);
    $setting->setPlugin('email');
    if ($setting_type == 'user') {
        $setting->setOwnerId($user_id);
        $setting->setType('user');
    } else {
        $setting->setOwnerId(0);
    }
    if (fRequest::isPost()) {
        try {
            $setting->populate();
            fRequest::validateCSRFToken(fRequest::get('token'));
            $setting->store();
            $setting_url = Setting::makeUrl('list', $setting_type);
            fMessaging::create('affected', fURL::get());
            fMessaging::create('success', fURL::get(), 'The setting ' . $setting->getFriendlyName() . ' was successfully created');
开发者ID:nagyist,项目名称:Tattle,代码行数:31,代码来源:setting.php

示例4: setSettingDirectly

 function setSettingDirectly($object, $objecttype, $name, $value, $mode = "", $language = "")
 {
     $setting = new Setting();
     $setting->setSuid($this->getSuid());
     $setting->setLanguage($language);
     $setting->setMode($mode);
     $setting->setName($name);
     $setting->setObject($object);
     $setting->setObjectType($objecttype);
     $setting->setValue($value);
     $setting->save();
 }
开发者ID:nubissurveying,项目名称:nubis,代码行数:12,代码来源:survey.php

示例5: getSettingValue

     }
     return "";
 }
 function getSettingValue($name, $default = true)
 {
     return $this->getSetting($name, $default)->getValue();
 }
 function setSettingValue($name, $value)
 {
     /* determine index */
     $index = strtoupper($name . getSurveyMode() . getSurveyLanguage() . $this->getObjectType());
     /* don't store if follow generic/follow type (these are implicitly derived, 
      * so no need to store them explicitly). Also don't store if empty (if something should be empty
      * like a text, then enter   for example as value).
      * If we had a value stored before, then we remove it now.
      */
     if (inArray($value, array("", SETTING_FOLLOW_GENERIC, SETTING_FOLLOW_TYPE))) {
         if (isset($this->settings[$index])) {
             $s = $this->settings[$index];
             if ($s != null) {
                 $s->remove();
             }
             unset($this->settings[$index]);
         }
         return;
     }
     /* update */
     if (isset($this->settings[$index])) {
         $this->settings[$index]->setValue($value);
     } else {
         /* create new */
开发者ID:nubissurveying,项目名称:nubis,代码行数:31,代码来源:component.php


注:本文中的Setting::setName方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。