本文整理汇总了PHP中CIBlockSection类的典型用法代码示例。如果您正苦于以下问题:PHP CIBlockSection类的具体用法?PHP CIBlockSection怎么用?PHP CIBlockSection使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
在下文中一共展示了CIBlockSection类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的PHP代码示例。
示例1: onBeforeElementAddHandler
static function onBeforeElementAddHandler($arFields)
{
$IBLOCK_ID = Config\Option::get("citfact.replaceurl", "IBLOCK_ID", "");
$SECTION_ID = Config\Option::get("citfact.replaceurl", "SECTION_BREND_ID", "BRENDI");
$CODE_PROP = Config\Option::get("citfact.replaceurl", "PROPERTY_CODE_BRENDI", "BRENDI");
if ($IBLOCK_ID == $arFields["IBLOCK_ID"]) {
$propertyBrand = \CIBlockProperty::GetByID($CODE_PROP, $arFields["IBLOCK_ID"]);
if ($arResultProperty = $propertyBrand->GetNext()) {
$propertyBrandValue = \CIBlockPropertyEnum::GetByID($arFields["PROPERTY_VALUES"][$arResultProperty["ID"]][0]["VALUE"]);
}
$rqParentSection = \CIBlockSection::GetByID($SECTION_ID);
if ($arParentSection = $rqParentSection->GetNext()) {
$arFilter = array('IBLOCK_ID' => $arParentSection['IBLOCK_ID'], '>LEFT_MARGIN' => $arParentSection['LEFT_MARGIN'], '<RIGHT_MARGIN' => $arParentSection['RIGHT_MARGIN'], '>DEPTH_LEVEL' => $arParentSection['DEPTH_LEVEL']);
// выберет потомков без учета активности
$rqSectChild = \CIBlockSection::GetList(array('left_margin' => 'asc'), $arFilter);
while ($arSectChild = $rqSectChild->GetNext()) {
$arSections[$arSectChild["NAME"]] = $arSectChild["ID"];
}
}
if (array_key_exists($propertyBrandValue["VALUE"], $arSections)) {
$arFields["IBLOCK_SECTION"][] = $arSections[$propertyBrandValue["VALUE"]];
} else {
$arParams = array("replace_space" => "-", "replace_other" => "-");
$trans = \Cutil::translit($propertyBrandValue["VALUE"], "ru", $arParams);
$bs = new \CIBlockSection();
$arFieldsNewSection = array("ACTIVE" => "Y", "IBLOCK_SECTION_ID" => $SECTION_ID, "IBLOCK_ID" => $IBLOCK_ID, "NAME" => $propertyBrandValue["VALUE"], "CODE" => $trans);
$resultAdd = $bs->Add($arFieldsNewSection);
$arFields["IBLOCK_SECTION"][] = $resultAdd;
}
}
return true;
}
开发者ID:ASDAFF,项目名称:citfact.replaceurl,代码行数:32,代码来源:Event.php
示例2: __wd_get_root_section
function __wd_get_root_section($IBLOCK_ID, $object, $object_id)
{
$result = CIBlockWebdavSocnet::GetSectionID($IBLOCK_ID, $object, $object_id);
if (intval($result) > 0) {
return $result;
} else {
__wd_check_uf_use_bp_property($arParams["IBLOCK_ID"]);
$arFields = array("IBLOCK_ID" => $IBLOCK_ID, "ACTIVE" => "Y", "SOCNET_GROUP_ID" => false, "IBLOCK_SECTION_ID" => 0, "UF_USE_BP" => "N");
if ($object == "user") {
$dbUser = CUser::GetByID($object_id);
$arUser = $dbUser->Fetch();
$arFields["NAME"] = trim($arUser['LAST_NAME'] . " " . $arUser['FIRST_NAME']);
$arFields["NAME"] = trim(!empty($arFields["NAME"]) ? $arFields["NAME"] : $arUser['LOGIN']);
$arFields['CREATED_BY'] = $arUser['ID'];
$arFields['MODIFIED_BY'] = $arUser['ID'];
if (CIBlock::GetArrayByID($IBLOCK_ID, "RIGHTS_MODE") === "E") {
$arTasks = CWebDavIblock::GetTasks();
$arFields['RIGHTS'] = array('n0' => array('GROUP_CODE' => 'U' . $object_id, 'TASK_ID' => $arTasks['X']));
}
} else {
/* $res = CSocNetGroup::GetByID($arResult["VARIABLES"]["group_id"]);
if (!$res)
{
$arParams["ERROR_MESSAGE"] = GetMessage("SONET_GROUP_NOT_EXISTS");
return 0;
} */
$arFields["SOCNET_GROUP_ID"] = $object_id;
//$arGroup = CSocNetGroup::GetByID($object_id);
$arFields["NAME"] = GetMessage("SONET_GROUP_PREFIX") . $object_id;
$dbGroup = CSocNetGroup::GetList(array(), array("ID" => (int) $object_id), false, false, array("ID", "SITE_ID", "NAME"));
if ($arGroup = $dbGroup->Fetch()) {
$arFields["NAME"] = GetMessage("SONET_GROUP_PREFIX") . $arGroup["NAME"];
}
if (CIBlock::GetArrayByID($IBLOCK_ID, "RIGHTS_MODE") === "E") {
$arTasks = CWebDavIblock::GetTasks();
$arFields['RIGHTS'] = array('n0' => array('GROUP_CODE' => 'SG' . $arFields["SOCNET_GROUP_ID"] . '_A', 'TASK_ID' => $arTasks['X']), 'n1' => array('GROUP_CODE' => 'SG' . $arFields["SOCNET_GROUP_ID"] . '_E', 'TASK_ID' => $arTasks['W']), 'n2' => array('GROUP_CODE' => 'SG' . $arFields["SOCNET_GROUP_ID"] . '_K', 'TASK_ID' => $arTasks['W']));
}
}
if (\Bitrix\Main\Config\Option::get('disk', 'successfully_converted', false) && CModule::includeModule('disk')) {
\Bitrix\Disk\Driver::getInstance()->addGroupStorage($arFields["SOCNET_GROUP_ID"]);
}
$GLOBALS["UF_USE_BP"] = $arFields["UF_USE_BP"];
$GLOBALS["USER_FIELD_MANAGER"]->EditFormAddFields("IBLOCK_" . $IBLOCK_ID . "_SECTION", $arFields);
$bs = new CIBlockSection();
$sectionID = $bs->Add($arFields);
if (!$sectionID) {
$arParams["ERROR_MESSAGE"] = $bs->LAST_ERROR;
return 0;
}
WDClearComponentCache(array("webdav.element.edit", "webdav.element.hist", "webdav.element.upload", "webdav.element.view", "webdav.menu", "webdav.section.edit", "webdav.section.list"));
return true;
/*
if ($ob->workflow == 'bizproc')
{
__wd_create_default_bp_user_and_groups($arBizProcParameters);
}
*/
}
}
开发者ID:webgksupport,项目名称:alpina,代码行数:59,代码来源:webdav_settings.php
示例3: testAdd
public function testAdd()
{
$this->_injectDutyCollector();
$ibType = \CIBlockType::GetList()->Fetch();
$ib = new \CIBlock();
$ibId = $ib->Add(array('IBLOCK_TYPE_ID' => $ibType['ID'], 'NAME' => 'New Iblock', 'SITE_ID' => 's1'));
$this->assertNotEmpty($ibId, $this->errorMessage('not create iblock id', array(':lastError' => $ib->LAST_ERROR)));
$prop = new \CIBlockProperty();
$propId = $prop->Add(array('IBLOCK_ID' => $ibId, 'CODE' => 'propCode', 'NAME' => 'Property NAME'));
$this->assertNotEmpty($propId, $this->errorMessage('not create property iblock id', array(':lastError' => $ib->LAST_ERROR)));
$sec = new \CIBlockSection();
$secId = $sec->Add(array('IBLOCK_ID' => $ibId, 'NAME' => 'Iblock Section'));
$this->assertNotEmpty($secId, $this->errorMessage('not create section iblock id', array(':lastError' => $ib->LAST_ERROR)));
// ¬ итоге должны получитс¤
// данные по добавлению »Ѕ
$this->assertNotEmpty($this->_getCollectorFixes(AddProcess::className(), IblockHandler::className()));
// данные по добавлению свойства
$this->assertNotEmpty($this->_getCollectorFixes(AddProcess::className(), IblockPropertyHandler::className()));
// данные по добавлению секции
$this->assertNotEmpty($this->_getCollectorFixes(AddProcess::className(), IblockSectionHandler::className()));
$refFixes = $this->_getCollectorFixes('reference');
// фиксаци¤ изменений
Module::getInstance()->commitDutyChanges();
// добавлены записи журнала обновлений (в базу)
/** @var $logRecords AppliedChangesLogModel[] */
$logRecords = AppliedChangesLogModel::find(array('order' => array('id' => 'desc'), 'limit' => 10));
$this->assertTrue(count($logRecords) > 3);
$iterationsCount = 0;
foreach ($logRecords as $logRecord) {
if ($logRecord->processName == Module::SPECIAL_PROCESS_FIX_REFERENCE) {
continue;
}
if ($logRecord->processName != AddProcess::className()) {
$this->throwError($this->errorMessage('last log records need been update process'), $logRecord->processName);
}
if (++$iterationsCount > 3) {
break;
}
$data = $logRecord->updateData;
switch ($logRecord->subjectName) {
case IblockHandler::className():
(!$data['iblock'] || $data['iblock']['ID'] != $ibId) && $this->throwError($this->errorMessage('iblock not registered after update', array(':actual' => $data['iblock']['ID'], ':need' => $ibId)));
break;
case IblockPropertyHandler::className():
$data['ID'] != $propId && $this->throwError($this->errorMessage('property iblock not registered after update', array(':original' => $propId, ':actual' => $data['ID'])));
break;
case IblockSectionHandler::className():
$data['ID'] != $secId && $this->throwError($this->errorMessage('section iblock not registered after update', array(':original' => $secId, ':actual' => $data['ID'])));
break;
}
}
// добавлены три вида ссылок в фиксаци¤х
$this->assertEquals(3, count($refFixes), $this->errorMessage('links expected count', array(':count' => 3)));
$this->_iblockId = $ibId;
$this->_propertyId = $propId;
$this->_sectionId = $secId;
}
开发者ID:ASDAFF,项目名称:bitrix-module-migrations,代码行数:57,代码来源:fixtestcase.php
示例4: existsSectionByExternalId
static function existsSectionByExternalId($external_id)
{
$result = false;
$bs = new CIBlockSection();
$ob_section = $bs->GetList(array("SORT" => "ASC"), array("IBLOCK_ID" => self::$IBLOCK_ID, "EXTERNAL_ID" => $external_id), false, array("ID"));
if ($ar_section = $ob_section->GetNext()) {
$result = $ar_section["ID"];
}
return $result;
}
开发者ID:TzepART,项目名称:functionsAndClasses,代码行数:10,代码来源:photo.php
示例5: executeUp
function executeUp()
{
CModule::IncludeModule('iblock');
$obj_ib_section = new CIBlockSection();
$r = $obj_ib_section->Add(array('NAME' => 'new section here', 'CODE' => 'new_section_here', 'ACTIVE' => 'N', 'IBLOCK_ID' => self::IBLOCK_ID));
if (!$r) {
throw new \Exception('Err adding section:' . $obj_ib_section->LAST_ERROR);
}
return true;
}
开发者ID:u-mulder,项目名称:bixmigs,代码行数:10,代码来源:Mgr_20150101_102032_task_2003.php
示例6: existsSectionByCode
static function existsSectionByCode($code)
{
$result = false;
$bs = new CIBlockSection();
$ob_section = $bs->GetList(array("SORT" => "ASC"), array("IBLOCK_ID" => self::$IBLOCK_ID, "CODE" => $code), false, array("ID", "CODE"));
if ($ar_section = $ob_section->GetNext()) {
$result = $ar_section["ID"];
}
return $result;
}
开发者ID:TzepART,项目名称:functionsAndClasses,代码行数:10,代码来源:news.php
示例7: IblockSectionCreate
/**
* @param array $params
*/
protected function IblockSectionCreate(array $params)
{
$bs = new \CIBlockSection();
$res = $bs->Add($params);
if (!$res) {
throw new \Exception($bs->LAST_ERROR);
} else {
return $res;
}
}
开发者ID:marvin255,项目名称:bxmigrate,代码行数:13,代码来源:Coded.php
示例8: EnsureProductSection
private static function EnsureProductSection($externalID, $catalogID, $arFields)
{
$section = new CIBlockSection();
$rsSections = $section->GetList(array(), array('XML_ID' => $externalID, 'IBLOCK_ID' => $catalogID), false, array('ID'));
$arSection = $rsSections->Fetch();
if (is_array($arSection)) {
return intval($arSection['ID']);
}
$sectionID = $section->Add(array('IBLOCK_ID' => $catalogID, 'ACTIVE' => 'Y', 'NAME' => $arFields['NAME'], 'IBLOCK_SECTION_ID' => 0, 'CHECK_PERMISSIONS' => 'N', 'XML_ID' => $externalID));
return $sectionID;
}
开发者ID:mrdeadmouse,项目名称:u136006,代码行数:11,代码来源:product.demo.php
示例9: checkDoubleSection
/**
* Verify the existence of duplicate sections.
*
* @param array $fields Section fields.
* @param array $settings Internationalization settings of info block.
* @return bool
*/
protected static function checkDoubleSection(array $fields, $settings)
{
global $APPLICATION;
$sectionModel = new \CIBlockSection();
$rsSection = $sectionModel->GetList([], ['IBLOCK_ID' => $fields['IBLOCK_ID'], 'UF_' . $settings['PROP_CODE_PUBLIC_ID'] => $fields['UF_' . $settings['PROP_CODE_PUBLIC_ID']], 'UF_' . $settings['PROP_CODE_LANG'] => $fields['UF_' . $settings['PROP_CODE_LANG']], '!ID' => $fields['ID']], false, ['ID']);
if ($section = $rsSection->Fetch()) {
$APPLICATION->ThrowException(Loc::getMessage('NOTAMEDIA_I18N_IBLOCK_HANDLER_ELEMENT_ALREADY_EXIST'));
return true;
}
return false;
}
开发者ID:notamedia,项目名称:bitrix-i18n,代码行数:18,代码来源:sectionhandler.php
示例10: addSection
public function addSection($iblockId, $fields = array())
{
$default = array("ACTIVE" => "Y", "IBLOCK_SECTION_ID" => false, "NAME" => 'section', "CODE" => '', "SORT" => 100, "PICTURE" => false, "DESCRIPTION" => '', "DESCRIPTION_TYPE" => 'text');
$fields = array_merge($default, $fields);
$fields["IBLOCK_ID"] = $iblockId;
$ib = new \CIBlockSection();
$id = $ib->Add($fields);
if ($id) {
return $id;
}
$this->throwException(__METHOD__, $ib->LAST_ERROR);
}
开发者ID:Hawkart,项目名称:megatv,代码行数:12,代码来源:IblockHelper.php
示例11: addSectionReview
function addSectionReview($NAME, $CODE, $IBLOCK_ID)
{
CModule::IncludeModule('iblock');
$bs = new CIBlockSection();
$arFields = array("ACTIVE" => 'Y', "IBLOCK_ID" => $IBLOCK_ID, "NAME" => $NAME, "CODE" => $CODE);
$ID = $bs->Add($arFields);
$res = $ID > 0;
if (!$res) {
echo $bs->LAST_ERROR;
}
return $ID;
}
开发者ID:CheBurashka334,项目名称:zakrepi,代码行数:12,代码来源:add_comment.php
示例12: GetEditFormHTML
public function GetEditFormHTML($userField, $htmlControl)
{
$request = Application::getInstance()->getContext()->getRequest();
$iblockId = intval(str_replace(['IBLOCK_', '_SECTION'], '', $userField['ENTITY_ID']));
if (empty($userField['VALUE']) && $request->get('I18N_RELATED_ID')) {
$sectionModel = new \CIBlockSection();
$rsRelatedSection = $sectionModel->GetList([], ['IBLOCK_ID' => $iblockId, 'ID' => $request->get('I18N_RELATED_ID')], false, ['ID', $userField['FIELD_NAME']]);
if ($relatedSection = $rsRelatedSection->Fetch()) {
$userField['VALUE'] = $relatedSection[$userField['FIELD_NAME']];
}
}
return $userField['VALUE'] . '<input type="hidden" name="' . $htmlControl['NAME'] . '" value="' . $userField['VALUE'] . '">';
}
开发者ID:notamedia,项目名称:bitrix-i18n,代码行数:13,代码来源:publicidfield.php
示例13: getImage
/**
* Возвращает путь до картинки
*/
function getImage($arProperty)
{
$current = self::getCurrent($arProperty);
$image = null;
$p = strtoupper($arProperty['USER_TYPE_SETTINGS']['PROPERTY_NAME']);
$link = strtoupper($arProperty['USER_TYPE_SETTINGS']['PROPERTY_LINK']);
if ($link && !empty($current[$link])) {
//узнаем инфоблок привязанного свойства
if ($link === 'IBLOCK_SECTION_ID') {
$res = \CIBlockSection::GetById($current[$link]);
if ($ob = $res->Fetch()) {
$image = isset($ob[$p]) ? $ob[$p] : null;
}
} else {
$res = \CIBlockElement::GetById($current[$link]);
if ($ob = $res->Fetch()) {
if (strpos($p, 'PROPERTY_') === 0) {
$pres = \CIBlockElement::GetProperty($ob['IBLOCK_ID'], $ob['ID'], [], ['CODE' => substr($p, 9)]);
if ($pob = $pres->Fetch()) {
$image = $pob['VALUE'];
}
} else {
$image = isset($ob[$p]) ? $ob[$p] : null;
}
}
}
} elseif (!empty($current[$p])) {
$image = $current[$p];
}
if ($image && is_numeric($image)) {
$image = \CFile::GetPath($image);
}
return $image;
}
开发者ID:marvin255,项目名称:bxlib,代码行数:37,代码来源:CanvasPolygon.php
示例14: addSection
/**
* [addSectionIblock description]
* @param object $section
* @param int $lvl
* @return array
*/
protected function addSection($section, $lvl, $idParent, $sort){
if (!CModule::IncludeModule("iblock")):
return array("result" => false);
endif;
$bs = new CIBlockSection;
$IBLOCK_ID = 17;
$NAME = $section->Наименование;
$id1c = $section->Ид;
$ID = $this->findSection($NAME);
$translitParams = $this->translitParams();
$arFields = Array(
"ACTIVE" => "Y",
"IBLOCK_SECTION_ID" => $idParent,
"IBLOCK_ID" => $this->getIblockId(),
"NAME" => $NAME,
"CODE" => CUtil::translit($NAME, "ru", $translitParams),
"DEPTH_LEVEL" => $lvl,
"SORT" => $sort,
"UF_1C_ID" => $id1c,
"PICTURE" => CFile::MakeFileArray($_SERVER["DOCUMENT_ROOT"]."/upload/1c_catalog/".$section->Картинка)
);
if($ID <= 0):
$ID = $bs->Add($arFields);
$res = ($ID>0);
else:
$res = $bs->Update($ID, $arFields);
endif;
if(!$res):
return array("result" => false);
else:
return array("result" => true, "id" => $ID);
endif;
}
开发者ID:akniyev,项目名称:arteva.ru,代码行数:39,代码来源:addSections.php
示例15: addVariants
public function addVariants(&$field, $params)
{
if (!$params["LINK_IBLOCK_ID"]) {
return;
}
$cacheDir = KFilter::$config['CACHE_DIR'] . self::$cacheSubdir;
$obCache = new CPHPCache();
if ($obCache->InitCache(KFilter::$config['CACHE_TIME'], md5($params["LINK_IBLOCK_ID"] . __METHOD__), $cacheDir)) {
$field['VARIANTS'] = $obCache->GetVars();
} elseif ($obCache->StartDataCache()) {
CModule::IncludeModule('iblock');
global $CACHE_MANAGER;
$CACHE_MANAGER->StartTagCache($cacheDir);
$CACHE_MANAGER->RegisterTag("iblock_id_" . $params["LINK_IBLOCK_ID"]);
$CACHE_MANAGER->EndTagCache();
$rsSect = CIBlockSection::GetList(array('sort' => 'asc', 'name' => 'asc'), array('IBLOCK_ID' => $params["LINK_IBLOCK_ID"], 'ACTIVE' => 'Y'), false, array('ID', 'NAME'));
while ($arSect = $rsSect->GetNext()) {
$field['VARIANTS'][] = array('ID' => $arSect['ID'], 'NAME' => $arSect['NAME']);
}
$obCache->EndDataCache($field['VARIANTS']);
}
foreach ($field['VARIANTS'] as &$section) {
if ($_REQUEST[$field['NAME']] == $section['ID']) {
$section['SELECTED'] = 'Y';
$res = CIBlockElement::GetList(array(), array("IBLOCK_ID" => $params["LINK_IBLOCK_ID"], "SECTION_ID" => $section['ID']), false, false, array("ID", "IBLOCK_ID"));
$arr = array();
while ($el = $res->GetNext()) {
$arr[] = $el['ID'];
}
$this->filter['PROPERTY_' . $field['PROPERTY']] = $arr;
break;
}
}
}
开发者ID:ASDAFF,项目名称:bitrix-modules-advancedfilter,代码行数:34,代码来源:kfsectlinkelement.php
示例16: getSefviceMediaspect
public static function getSefviceMediaspect($service_id, $section_id = false)
{
$result = false;
if (!$section_id) {
$res = CIBlockElement::GetByID($service_id);
if ($element = $res->GetNext()) {
$section_id = $element["IBLOCK_SECTION_ID"];
}
}
if ($section_id) {
$section = DrclinicsHelper::getMediaspects($section_id);
$section = end($section);
if ($section) {
$result = $section;
} else {
$nav = CIBlockSection::GetNavChain(false, $section_id, array("ID", "CODE", "SECTION_PAGE_URL", "DEPTH_LEVEL"));
while (($arSectionPath = $nav->GetNext()) && $arSectionPath["DEPTH_LEVEL"] != 2) {
}
if ($arSectionPath) {
$result = $arSectionPath;
}
}
}
return $result;
}
开发者ID:romlg,项目名称:bitrixcode,代码行数:25,代码来源:DrclinicsServicesHelper.php
示例17: GetSections
public function GetSections($ib, $subsection = false)
{
CModule::IncludeModule("iblock");
if (!is_array($ib) || empty($ib)) {
return array();
}
$arFilter = array("IBLOCK_ID" => $ib);
if (!$subsection) {
$arFilter["DEPTH_LEVEL"] = 1;
}
$dbSection = CIBlockSection::GetList(array("NAME" => "ASC"), $arFilter);
$sections = array();
while ($arSection = $dbSection->Fetch()) {
$sections[$arSection["DEPTH_LEVEL"]][$arSection["ID"]] = array("ID" => $arSection["ID"], "NAME" => "{$arSection["NAME"]} [{$arSection["ID"]}]", "LEVEL" => $arSection["DEPTH_LEVEL"], "PARENT" => $arSection["IBLOCK_SECTION_ID"], "PARENT_1" => $arSection["ID"]);
}
unset($dbSection);
ksort($sections);
foreach ($sections as $depth => &$depthSections) {
if ($depth == 1) {
continue;
}
foreach ($depthSections as $id => &$current) {
$current["NAME"] = implode(" / ", array($sections[$depth - 1][$current["PARENT"]]["NAME"], $current["NAME"]));
$current["PARENT_1"] = $sections[$depth - 1][$current["PARENT"]]["PARENT_1"];
}
}
return $sections;
}
开发者ID:akniyev,项目名称:itprom_dobrohost,代码行数:28,代码来源:cexportproprofile.php
示例18: _getIBlockMode
function _getIBlockMode($ib, $object = false, $object_id = false)
{
if ($object === false) {
$arIBlock = CIBlock::GetArrayByID($ib);
if ($arIBlock["WORKFLOW"] == "Y") {
return "WF";
} elseif ($arIBlock["BIZPROC"] == "Y") {
return "BP";
} else {
return "";
}
} else {
$arFilter = array("IBLOCK_ID" => $ib, "SOCNET_GROUP_ID" => false, "CHECK_PERMISSIONS" => "N", "SECTION_ID" => 0);
if ($object == "user") {
$arFilter["CREATED_BY"] = $object_id;
} else {
$arFilter["SOCNET_GROUP_ID"] = $object_id;
}
$arLibrary = array();
$db_res = CIBlockSection::GetList(array(), $arFilter, false, array("ID", "UF_USE_BP"));
if ($db_res && ($arLibrary = $db_res->GetNext())) {
return $arLibrary["UF_USE_BP"] == "N" ? "" : "BP";
} else {
return "";
}
}
}
开发者ID:mrdeadmouse,项目名称:u136006,代码行数:27,代码来源:functions.php
示例19: testAdd
public function testAdd()
{
/** @var $dbList \CDBResult */
$dbList = \CIBlock::GetList();
$ibCountBefore = $dbList->SelectedRowsCount();
$beforeIds = array();
while ($arIblock = $dbList->Fetch()) {
$beforeIds[] = $arIblock['ID'];
}
$this->_applyFixtures(self::FIXTURE_TYPE_ADD);
$dbList = \CIBlock::GetList();
$ibCountAfter = $dbList->SelectedRowsCount();
$afterIds = array();
while ($arIblock = $dbList->Fetch()) {
$afterIds[] = $arIblock['ID'];
}
$aAddedId = array_diff($afterIds, $beforeIds);
$this->_processIblockId = array_shift($aAddedId);
$this->assertNotEmpty($ibCountAfter, $this->errorMessage('record IB must be present'));
$this->assertNotEquals($ibCountAfter, $ibCountBefore, $this->errorMessage('not also recording information block'));
$this->assertNotEmpty($this->_processIblockId, $this->errorMessage('unavailable identifier of the new information block'));
$rsProps = \CIBlockProperty::GetList(null, array('IBLOCK_ID' => $this->_processIblockId));
$this->assertNotEmpty($rsProps->AffectedRowsCount(), $this->errorMessage('added properties not available information block', array(':iblockId' => $this->_processIblockId)));
$rsSections = \CIBlockSection::getList(null, array('IBLOCK_ID' => $this->_processIblockId), false, array('ID'));
$this->assertNotEmpty($rsSections->AffectedRowsCount(), $this->errorMessage('added sections not available information block'));
$registerRef = (bool) DbVersionReferencesTable::getList(array('filter' => array('=DB_VERSION' => Module::getInstance()->getDbVersion(), '=GROUP' => ReferenceController::GROUP_IBLOCK, '=ITEM_ID' => $this->_processIblockId)))->fetch();
$this->assertTrue($registerRef, $this->errorMessage('In added apply not created iblock reference ' . $this->_processIblockId));
}
开发者ID:ASDAFF,项目名称:bitrix-module-migrations,代码行数:28,代码来源:updatetestcase.php
示例20: __get
/**
* Геттер
* @param $var
* @return int
*/
public function __get($var)
{
if (strpos($var, 'printable_') === 0) {
$varName = substr($var, strlen('printable_'));
$param = $this->getParam($varName);
if (!is_array($param) || !isset($param['PROPERTY_TYPE'])) {
return $param;
}
switch ($param['PROPERTY_TYPE']) {
case 'G':
$printable = \CIBlockSection::GetList(array(), array('ID' => $param['VALUE']), false, array("NAME"))->GetNext();
return $printable['NAME'];
default:
$printable = \CIBlockFormatProperties::GetDisplayValue(array('NAME' => ''), $param, "");
return $printable['DISPLAY_VALUE'];
}
} else {
switch ($var) {
case 'id':
case 'ID':
return $this->id;
case 'IBLOCK_ID':
case 'iblockId':
return $this->iblockId;
default:
return $this->getParam($var);
}
}
}
开发者ID:ASDAFF,项目名称:Bitrix,代码行数:34,代码来源:IblockObject.php
注:本文中的CIBlockSection类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论