Add
bool CIBlockType::Add( array arFields );
The method creates a new type of information blocks. This method cannot be called as a static function.
Parameters
Parameter | Description |
---|---|
arFields |
Array of pairs field=>value. Contains values of the information
block type fields. The array entry arFields["LANG"]
should contain an array of the language-dependent
parameters of information block type.
|
Return Values
The method returns true on success. In case of failure, it returns false and sets the property LAST_ERROR to the error description.See Also
Example
<? $arFields = Array( 'ID'=>'catalog', 'SECTIONS'=>'Y', 'IN_RSS'=>'N', 'SORT'=>100, 'LANG'=>Array( 'en'=>Array( 'NAME'=>'Catalog', 'SECTION_NAME'=>'Sections', 'ELEMENT_NAME'=>'Products') ) ); $obBlocktype = new CIBlockType; $DB->StartTransaction(); $res = $obBlocktype->Add($arFields); if (!$res) { $DB->Rollback(); echo 'Error: '.$obBlocktype->LAST_ERROR.'<br>'; } else { $DB->Commit(); } ?>
© «Bitrix24», 2001-2024