当前位置: 首页>>代码示例>>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;未经允许,请勿转载。