andreyryabin / sprint.migration

Миграции для разработчиков (1С-Битрикс)
http://marketplace.1c-bitrix.ru/solutions/sprint.migration/
MIT License
173 stars 56 forks source link

added the update property by CODE method in helpers #8

Closed maxlyaptsev closed 6 years ago

maxlyaptsev commented 6 years ago

added the update property by CODE method, because the ID is implicit after migration

andreyryabin commented 6 years ago

Максим, есть же такой метод


        $iblockId = $helper->Iblock()->getIblockId('IBLOCK_CODE');

        $helper->Iblock()->updatePropertyIfExists($iblockId,'PROP_CODE', array(
            //...
        ));
andreyryabin commented 6 years ago

или вот так


        $iblockId = $helper->Iblock()->getIblockId('IBLOCK_CODE');
        $propertyId = $helper->Iblock()->getPropertyId($iblockId, 'PROP_CODE');

        $helper->Iblock()->updatePropertyById($propertyId, array(
            //...
        ));