本文整理汇总了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>';
}
示例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);
}