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


PHP SiteTable::getById方法代码示例

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


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

示例1: getHtml

 public function getHtml()
 {
     $logLevel = !empty($this->ebaySettings[$this->siteId]["LOG_LEVEL"]) ? htmlspecialcharsbx($this->ebaySettings[$this->siteId]["LOG_LEVEL"]) : Logger::LOG_LEVEL_ERROR;
     $notificationEmail = !empty($this->ebaySettings[$this->siteId]["EMAIL_ERRORS"]) ? htmlspecialcharsbx($this->ebaySettings[$this->siteId]["EMAIL_ERRORS"]) : "";
     $domainName = "";
     if (!empty($this->ebaySettings[$this->siteId]["DOMAIN_NAME"])) {
         $domainName = $this->ebaySettings[$this->siteId]["DOMAIN_NAME"];
     } else {
         $dbRes = \Bitrix\Main\SiteTable::getById($this->siteId);
         if ($site = $dbRes->fetch()) {
             $domainName = $site["SERVER_NAME"];
         }
         if (strlen($domainName) <= 0) {
             if (defined("SITE_SERVER_NAME") && strlen(SITE_SERVER_NAME) > 0) {
                 $domainName = SITE_SERVER_NAME;
             } else {
                 $domainName = \COption::GetOptionString("main", "server_name", "www.bitrixsoft.com");
             }
         }
     }
     $domainName = htmlspecialcharsbx($domainName);
     return '<table>' . '<tr><td>' . Loc::getMessage('SALE_EBAY_W_STEP_SITE_CHOOSE') . ':</td><td>' . \CLang::SelectBox("SITE_ID_SELECTED", $this->siteId) . '<input type="hidden" name="EBAY_SETTINGS[LOG_LEVEL]" value="' . $logLevel . '">' . '<input type="hidden" name="EBAY_SETTINGS[DOMAIN_NAME]" value="' . $domainName . '">' . '</td></tr>' . '<tr><td>' . Loc::getMessage('SALE_EBAY_W_STEP_EMAIL') . ': ' . '</td><td>' . '<input type="text" name="EBAY_SETTINGS[EMAIL_ERRORS]" size="45" maxlength="255" value="' . $notificationEmail . '">' . '</td></tr>' . '</table>';
 }
开发者ID:Satariall,项目名称:izurit,代码行数:23,代码来源:ebay_wizard.php

示例2: getSiteFieldsArray

 /**
  * @param $sites
  * @return array
  * @throws \Bitrix\Main\ArgumentException
  * @throws \Bitrix\Main\ArgumentNullException
  */
 protected function getSiteFieldsArray($sites)
 {
     /*
     global $BX_EVENT_SITE_PARAMS;
     if($site_id !== false && isset($BX_EVENT_SITE_PARAMS[$site_id]))
     	return $BX_EVENT_SITE_PARAMS[$site_id];
     */
     $site_id = $sites[0];
     if (!empty($this->eventMessageId)) {
         $messageSiteDb = MailInternal\EventMessageSiteTable::getList(array('select' => array('SITE_ID'), 'filter' => array('EVENT_MESSAGE_ID' => $this->eventMessageId, 'SITE_ID' => $sites)));
         if ($arMessageSite = $messageSiteDb->Fetch()) {
             $site_id = $arMessageSite['SITE_ID'];
         }
     }
     $SITE_NAME = Config\Option::get("main", "site_name", $GLOBALS["SERVER_NAME"]);
     $SERVER_NAME = Config\Option::get("main", "server_name", $GLOBALS["SERVER_NAME"]);
     $DEFAULT_EMAIL_FROM = Config\Option::get("main", "email_from", "admin@" . $GLOBALS["SERVER_NAME"]);
     if (strlen($site_id) > 0) {
         $result = \Bitrix\Main\SiteTable::getById($site_id);
         if ($arSite = $result->fetch()) {
             $this->siteId = $arSite['LID'];
             $this->languageId = $arSite['LANGUAGE_ID'];
             $BX_EVENT_SITE_PARAMS[$site_id] = array("SITE_NAME" => $arSite["SITE_NAME"] != '' ? $arSite["SITE_NAME"] : $SITE_NAME, "SERVER_NAME" => $arSite["SERVER_NAME"] != '' ? $arSite["SERVER_NAME"] : $SERVER_NAME, "DEFAULT_EMAIL_FROM" => $arSite["EMAIL"] != '' ? $arSite["EMAIL"] : $DEFAULT_EMAIL_FROM, "LANGUAGE_ID" => $arSite['LANGUAGE_ID'], "SITE_ID" => $arSite['LID'], "SITE_DIR" => $arSite['DIR']);
             return $BX_EVENT_SITE_PARAMS[$site_id];
         }
     }
     return array("SITE_NAME" => $SITE_NAME, "SERVER_NAME" => $SERVER_NAME, "DEFAULT_EMAIL_FROM" => $DEFAULT_EMAIL_FROM);
 }
开发者ID:DarneoStudio,项目名称:bitrix,代码行数:34,代码来源:eventmessagecompiler.php


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