本文整理匯總了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");
}