當前位置: 首頁>>代碼示例>>PHP>>正文


PHP Language::setId方法代碼示例

本文整理匯總了PHP中Language::setId方法的典型用法代碼示例。如果您正苦於以下問題:PHP Language::setId方法的具體用法?PHP Language::setId怎麽用?PHP Language::setId使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在Language的用法示例。


在下文中一共展示了Language::setId方法的8個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。

示例1: createFromArray

 public function createFromArray($data)
 {
     $data = (object) $data;
     $instance = new Language();
     $instance->setId($data->id);
     $instance->setName($data->name);
     return $instance;
 }
開發者ID:rsicart,項目名稱:smartadserver,代碼行數:8,代碼來源:Language.php

示例2: verifySessionContentEditLanguage

 public function verifySessionContentEditLanguage()
 {
     $sSessionDefaultLanguage = Settings::getSetting("session_default", AdminManager::CONTENT_LANGUAGE_SESSION_KEY, null);
     if (LanguageQuery::create()->filterById($sSessionDefaultLanguage)->count() < 1) {
         $oLanguage = new Language();
         $oLanguage->setId($sSessionDefaultLanguage);
         $oLanguage->setPathPrefix($sSessionDefaultLanguage);
         $oLanguage->setIsActive(true);
         $oLanguage->save();
     }
 }
開發者ID:rapila,項目名稱:cms-base,代碼行數:11,代碼來源:SanityCheck.php

示例3: Language

 /**
  * Maps a Language object contained in a recordset to an object representation
  *
  * @param $rs Recordset filled with the object data
  * @return objeto Mapped Language object
  */
 function &mapOne($rs)
 {
     if ($rs == null) {
         return null;
     }
     $object = new Language();
     $object->setId($rs->fields["ID"]);
     $object->setCode($rs->fields["code"]);
     $object->setIsMain($rs->fields["isMain"]);
     $object->setTitle($rs->fields["title"]);
     return $object;
 }
開發者ID:BackupTheBerlios,項目名稱:icf-svn,代碼行數:18,代碼來源:languageMapper.php

示例4: createLanguageIfNoneExist

 /**
  * @param string $sLanguageId
  * use cases:
  * 1. at first users' creation
  * 2. fallback method, creates language if it does not exist, but not at first users' login time, i.e. when languages have been truncated
  * @return void
  */
 public static function createLanguageIfNoneExist($sLanguage, $oUser = null)
 {
     if (LanguageQuery::create()->count() > 0) {
         return;
     }
     $oLanguage = new Language();
     $oLanguage->setId($sLanguage);
     $oLanguage->setPathPrefix($sLanguage);
     $oLanguage->setIsActive(true);
     $oLanguage->setCreatedAt(date('c'));
     $oLanguage->setUpdatedAt(date('c'));
     if ($oUser) {
         $oLanguage->setCreatedBy($oUser->getId());
         $oLanguage->setUpdatedBy($oUser->getId());
     }
     LanguagePeer::ignoreRights(true);
     $oLanguage->save();
 }
開發者ID:rapila,項目名稱:cms-base,代碼行數:25,代碼來源:AdminManager.php

示例5: saveData

 public function saveData($aLanguageData)
 {
     // string key is changed if a existing Language string_key is changed
     if ($aLanguageData['language_id'] !== $this->sLanguageId) {
         $this->sLanguageId = $aLanguageData['language_id'];
     }
     $oLanguage = LanguageQuery::create()->findPk($this->sLanguageId);
     if ($oLanguage === null) {
         $oLanguage = new Language();
         $oLanguage->setId($aLanguageData['language_id']);
     }
     $this->validate($aLanguageData, $oLanguage);
     if (!Flash::noErrors()) {
         throw new ValidationException();
     }
     $oLanguage->setIsActive($aLanguageData['is_active']);
     $oLanguage->setPathPrefix($aLanguageData['path_prefix']);
     return $oLanguage->save();
 }
開發者ID:rapila,項目名稱:cms-base,代碼行數:19,代碼來源:LanguageDetailWidgetModule.php

示例6: redirect

    redirect("../login.php");
}
$database = new Database();
$user = new User();
$language = new Language();
$category = new Category();
if (isset($_POST['langName'])) {
    $langName = $database->escapeString($_POST['langName']);
    $language->setLangName($langName);
    if ($language->create($database)) {
        $columnName = strtolower($langName);
        $category->insertColumnForLanguage($database, $columnName);
        echo "true";
    } else {
        echo "false";
    }
} else {
    if (isset($_POST['languageIds'])) {
        foreach ($_POST['languageIds'] as $langId) {
            $language->setId($langId);
            $language->getById($database);
            if ($language->getLangName() != "") {
                $category->deleteColumnForLanguage($database, strtolower($language->getLangName()));
            }
            $language->delete($database);
        }
        echo "true";
    } else {
        echo "Try again later";
    }
}
開發者ID:jetmirhaxhisefa,項目名稱:rezervime,代碼行數:31,代碼來源:addAndDeleteLanguage.php

示例7: buildLanguageMenu

 /**
  * This method builds a menu.
  *
  * @access private
  * @author Kalmer Piiskop
  * @param string  $parameters['id']      the ID of the object
  * @param boolean $parameters['isError'] Are we in the error state?
  * @param string  $parameters['type']    the type of the object
  * @param string  $parameters['suffix']  the suffix
  * @param integer $parameters['width']   the width of <code>body</code> in
  * 		pixels
  * @return string the parsed menu
  * @uses ALIAS_HUMAN_LIST   for the translation of the list of humans
  * @uses ALIAS_OF_LANGUAGES for the list of languages
  * @uses ALT_LANGUAGE       for the alternative text of the update indicator
  * @uses DOMAIN             for addressing
  * @uses IMAGES_FOLDER      for displaying images
  * @uses O_FOLDER           for the common files
  * @uses LANGUAGE           for languages
  * @uses TITLE_LANGUAGE     for the explanation of the change of the
  * 		language
  */
 private static function buildLanguageMenu($parameters)
 {
     if (!isset($parameters['isError']) || !$parameters['isError']) {
         require_once 'HTML/Template/IT.php';
         $tpl = new \HTML_Template_IT(sprintf('%1$s/../assets/tpl/%2$u', dirname(__FILE__), $parameters['width']));
         $tpl->loadTemplatefile('languages.tpl');
         require_once O_FOLDER . '/keeled/Language.php';
         $language = new Language();
         if (isset($_SESSION['language'])) {
             $language->setId($_SESSION['language']);
             $idOfLanguageToExclude = $_SESSION['language'];
         } else {
             $language->setId(DEFAULT_LANGUAGE);
             $idOfLanguageToExclude = DEFAULT_LANGUAGE;
         }
         $language->setLanguage();
         require_once O_FOLDER . 'errors/Error.php';
         // echo ' 1658: ', $parameters['type'];
         $languagesInUse = Language::createLanguagesInUse(array('classes' => array('SystemMenuItem', 'Page', 'PageNews', 'SystemString'), 'idOfLanguageToExclude' => $idOfLanguageToExclude, 'object' => isset($parameters['id']) ? Error::requireFile(array('id' => $parameters['id'], 'type' => $parameters['type'], 'isInstance' => TRUE, 'isToBeCompleted' => TRUE, 'isView' => FALSE)) : NULL));
         // echo ' 1675: <pre>';print_r($languageInUse); echo '</pre>';
         $numberOfLanguage = 0;
         foreach ($languagesInUse as $languageInUse) {
             $numberOfLanguage++;
             if ($numberOfLanguage < 3) {
                 switch ($parameters['type']) {
                     case 'Error':
                         require_once O_FOLDER . '/keeled/SystemString.php';
                         $systemString = new SystemString();
                         $systemString->setId('errors_Error_error');
                         $systemString->setCompleteSystemString();
                         $alias = $systemString->translate(array('block' => 'title'));
                         break;
                     case 'Feedback':
                         require_once O_FOLDER . '/keeled/SystemString.php';
                         $systemString = new SystemString();
                         $systemString->setId('configuration_formOfFeedback');
                         $systemString->setCompleteSystemString();
                         $alias = $systemString->translate(array('block' => 'title'));
                         break;
                     case 'Hierarchy':
                         require_once O_FOLDER . '/keeled/SystemString.php';
                         $systemString = new SystemString();
                         $systemString->setId('configuration_hierarchy');
                         $systemString->setCompleteSystemString();
                         $alias = $systemString->translate(array('block' => 'title'));
                         break;
                     case 'Humans':
                         require_once O_FOLDER . '/keeled/SystemString.php';
                         $systemString = new SystemString();
                         $systemString->setId(ALIAS_HUMAN_LIST);
                         $systemString->setCompleteSystemString();
                         $alias = $systemString->translate(array('block' => 'title'));
                         break;
                     case 'Pages':
                         require_once O_FOLDER . '/keeled/SystemString.php';
                         $systemString = new SystemString();
                         $systemString->setId('configuration_pages');
                         $systemString->setCompleteSystemString();
                         $alias = $systemString->translate(array('block' => 'title'));
                         break;
                     case 'SystemStrings':
                         require_once O_FOLDER . '/keeled/SystemString.php';
                         $systemString = new SystemString();
                         $systemString->setId('configuration_systemStrings');
                         $systemString->setCompleteSystemString();
                         $alias = $systemString->translate(array('block' => 'title'));
                         break;
                     default:
                         require_once O_FOLDER . '/errors/Error.php';
                         $object = Error::requireFile(array('id' => $parameters['id'], 'type' => $parameters['type'], 'isInstance' => TRUE, 'isToBeCompleted' => TRUE, 'typeOfError' => 'JSON', 'isInstance' => TRUE, 'isView' => FALSE));
                         $object->setIdOfLanguage($languageInUse['id']);
                         $title = $object->translate(array('block' => 'title'));
                         // echo ' 1717: ', $title;
                         require_once O_FOLDER . 'Slug.php';
                         $alias = Slug::slugify(array('original' => $title));
                 }
                 $currentLanguage = new Language();
                 $currentLanguage->setId($languageInUse['id']);
//.........這裏部分代碼省略.........
開發者ID:piiskop,項目名稱:pstk,代碼行數:101,代碼來源:BodyView.php

示例8: createFromArray

 public function createFromArray($data)
 {
     $data = (object) $data;
     $userGroup = new UserGroup();
     $userGroup->setId($data->userGroupId);
     $language = new Language();
     $language->setId($data->languageId);
     $instance = new Site();
     $instance->setId($data->id);
     $instance->setName($data->name);
     $instance->setUserGroup($userGroup);
     $instance->setUrl($data->url);
     $instance->setLanguage($language);
     $instance->setIsArchived($data->isArchived);
     $instance->setUpdatedAt(new \DateTime($data->updatedAt));
     return $instance;
 }
開發者ID:rsicart,項目名稱:smartadserver,代碼行數:17,代碼來源:Site.php


注:本文中的Language::setId方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。