當前位置: 首頁>>代碼示例>>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;未經允許,請勿轉載。