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


PHP SiteTable::getByPrimary方法代碼示例

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


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

示例1: checkFields

 public static function checkFields(Entity\Result $result, $primary, array $data)
 {
     parent::checkFields($result, $primary, $data);
     if (isset($data['SITE_ID'])) {
         $selectResult = \Bitrix\Main\SiteTable::getByPrimary($data['SITE_ID']);
         if (!$selectResult->fetch()) {
             $field = static::getEntity()->getField('SITE_ID');
             $result->addError(new Entity\FieldError($field, Localization\Loc::getMessage('MAIN_ENTITY_FIELD_INVALID', array('#FIELD_TITLE#' => $field->getTitle())), Entity\FieldError::INVALID_VALUE));
         }
     }
     if (!empty($data['ICON'])) {
         if (!is_scalar($data['ICON']) || !preg_match('/[0-9]+/', $data['ICON'])) {
             $field = static::getEntity()->getField('ICON');
             $result->addError(new Entity\FieldError($field, Localization\Loc::getMessage('MAIN_ENTITY_FIELD_INVALID', array('#FIELD_TITLE#' => $field->getTitle())), Entity\FieldError::INVALID_VALUE));
         }
     }
     return $result;
 }
開發者ID:webgksupport,項目名稱:alpina,代碼行數:18,代碼來源:mailservices.php

示例2: array

        }
        $dbRes = SitemapEntityTable::getList(array("filter" => array("SITEMAP_ID" => $ID)));
        while ($arRes = $dbRes->fetch()) {
            if (!is_array($arSitemap['SETTINGS'][$arRes["ENTITY_TYPE"] . '_AUTO'])) {
                $arSitemap['SETTINGS'][$arRes["ENTITY_TYPE"] . '_AUTO'] = array();
            }
            $arSitemap['SETTINGS'][$arRes["ENTITY_TYPE"] . '_AUTO'][$arRes['ENTITY_ID']] = 'Y';
        }
        if (empty($arSitemap['SETTINGS']['FILENAME_FORUM'])) {
            $arSitemap['SETTINGS']['FILENAME_FORUM'] = "sitemap_forum_#FORUM_ID#.xml";
        }
        $SITE_ID = $arSitemap['SITE_ID'];
    }
}
if (strlen($SITE_ID) > 0) {
    $dbSite = Main\SiteTable::getByPrimary($SITE_ID);
    $arSite = $dbSite->fetch();
    if (!is_array($arSite)) {
        $SITE_ID = '';
    } else {
        $arSite['DOMAINS'] = array();
        $robotsFile = new RobotsFile($SITE_ID);
        if ($robotsFile->isExists()) {
            $arHostsList = $robotsFile->getRules('Host');
            foreach ($arHostsList as $rule) {
                $host = $rule[1];
                if (strncmp($host, 'https://', 8) === 0) {
                    $host = substr($host, 8);
                    $bDefaultHttps = true;
                }
                $arSite['DOMAINS'][] = $host;
開發者ID:webgksupport,項目名稱:alpina,代碼行數:31,代碼來源:seo_sitemap_edit.php

示例3: seoSitemapGetFilesData

if (!$USER->CanDoOperation('seo_tools')) {
    $APPLICATION->AuthForm(Loc::getMessage("ACCESS_DENIED"));
}
if (!Main\Loader::includeModule('seo')) {
    require $_SERVER["DOCUMENT_ROOT"] . "/bitrix/modules/main/include/prolog_admin_after.php";
    ShowError(Loc::getMessage("SEO_ERROR_NO_MODULE"));
    require $_SERVER["DOCUMENT_ROOT"] . "/bitrix/modules/main/include/epilog_admin.php";
}
$bIBlock = Main\Loader::includeModule('iblock');
$ID = intval($_REQUEST['ID']);
$NS = isset($_REQUEST['NS']) && is_array($_REQUEST['NS']) ? $_REQUEST['NS'] : array();
$arSitemap = null;
if ($ID > 0) {
    $dbSitemap = SitemapTable::getById($ID);
    $arSitemap = $dbSitemap->fetch();
    $dbSite = SiteTable::getByPrimary($arSitemap['SITE_ID']);
    $arSitemap['SITE'] = $dbSite->fetch();
}
if (!is_array($arSitemap)) {
    require $_SERVER["DOCUMENT_ROOT"] . "/bitrix/modules/main/include/prolog_admin_after.php";
    ShowError(Loc::getMessage("SEO_ERROR_SITEMAP_NOT_FOUND"));
    require $_SERVER["DOCUMENT_ROOT"] . "/bitrix/modules/main/include/epilog_admin.php";
} else {
    $arSitemap['SETTINGS'] = unserialize($arSitemap['SETTINGS']);
    $arSitemapSettings = array('SITE_ID' => $arSitemap['SITE_ID'], 'PROTOCOL' => $arSitemap['SETTINGS']['PROTO'] == 1 ? 'https' : 'http', 'DOMAIN' => $arSitemap['SETTINGS']['DOMAIN']);
}
function seoSitemapGetFilesData($PID, $arSitemap, $arCurrentDir, $sitemapFile)
{
    global $NS;
    $arDirList = array();
    if ($arCurrentDir['ACTIVE'] == SitemapRuntimeTable::ACTIVE) {
開發者ID:Satariall,項目名稱:izurit,代碼行數:31,代碼來源:seo_sitemap_run.php


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