Bitrix Site Manager

CIBlockType::Update

bool
CIBlockType::Update(
 string ID,
 array arFields
);

The method modifies the information block type parameters.

Parameters

ParameterDescription
ID Information block type ID.
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

  • CIBlockType::Add
  • Information block type fields

    Example


    <?
    $arFields = Array(
        '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->Update('catalog', $arFields);
    if(!$res)
    {
       $DB->Rollback();
       echo 'Error: '.$obBlocktype->LAST_ERROR.'<br>';
    }
    else
       $DB->Commit();
    ?>