本文整理汇总了PHP中CIBlockType::add方法的典型用法代码示例。如果您正苦于以下问题:PHP CIBlockType::add方法的具体用法?PHP CIBlockType::add怎么用?PHP CIBlockType::add使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类CIBlockType
的用法示例。
在下文中一共展示了CIBlockType::add方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: createIBlockType
protected static function createIBlockType()
{
$iblockType = array('ID' => 'bitrix_processes', 'SECTIONS' => 'Y', 'SORT' => 500, 'LANG' => array());
$by = "lid";
$order = "asc";
$langList = \CLanguage::GetList($by, $order, array("ACTIVE" => "Y"));
while ($lang = $langList->Fetch()) {
$iblockType['LANG'][$lang['LID']]['NAME'] = "Processes";
}
$iblockTypeList = \CIBlockType::GetList(array(), array('=ID' => $iblockType['ID']));
$res = $iblockTypeList->fetch();
if (!$res) {
$iblockTypeObject = new \CIBlockType();
$iblockTypeObject->add($iblockType);
$con = Main\Application::getConnection();
$con->queryExecute("\n\t\t\t\tinsert into b_lists_permission (IBLOCK_TYPE_ID, GROUP_ID)\n\t\t\t\tselect 'bitrix_processes', p.GROUP_ID\n\t\t\t\tfrom\n\t\t\t\t\tb_lists_permission p\n\t\t\t\t\tleft join b_lists_permission p2 on p2.GROUP_ID = p.GROUP_ID and p2.IBLOCK_TYPE_ID = 'bitrix_processes'\n\t\t\t\twhere\n\t\t\t\t\tp.IBLOCK_TYPE_ID = 'lists'\n\t\t\t\t\tand p2.IBLOCK_TYPE_ID is null\n\t\t\t");
global $CACHE_MANAGER;
$CACHE_MANAGER->Clean("b_lists_permission");
}
Main\Config\Option::set("lists", "livefeed_iblock_type_id", "bitrix_processes");
}