public function up()
 {
     $helper = new HelperManager();
     $hlblockId = $helper->Hlblock()->addHlblockIfNotExists(array('NAME' => 'Test', 'TABLE_NAME' => 'hl_test'));
     $helper->UserTypeEntity()->addUserTypeEntityIfNotExists('HLBLOCK_' . $hlblockId, 'UF_NAME', array('USER_TYPE_ID' => 'string'));
     $helper->UserTypeEntity()->addUserTypeEntityIfNotExists('HLBLOCK_' . $hlblockId, 'UF_CODE', array('USER_TYPE_ID' => 'string'));
 }
 public function up()
 {
     $helper = new HelperManager();
     $iblockId = $helper->Iblock()->getIblockId('content_news', 'content');
     $this->exitIfEmpty($iblockId, 'Инфоблок content_news не найден');
     $helper->AdminIblock()->buildElementForm($iblockId, array('Tab1' => array('ACTIVE|Активность', 'ACTIVE_FROM', 'ACTIVE_TO', 'NAME|Название', 'CODE|Символьный код', 'SORT'), 'Tab2' => array('PREVIEW_TEXT', 'PROPERTY_LINK')));
     $helper->AdminIblock()->buildElementList($iblockId, array('NAME', 'SORT', 'ID', 'PROPERTY_LINK'), array('order' => 'desc', 'by' => 'id', 'page_size' => 10));
 }
 public function down()
 {
     //Удаляем все элементы по 10 штук за раз
     $helper = new HelperManager();
     $iblockId1 = $helper->Iblock()->getIblockId('content_news');
     $this->exitIfEmpty($iblockId1, 'Инфоблок content_news не найден');
     /** @noinspection PhpDynamicAsStaticMethodCallInspection */
     $dbRes = \CIBlockElement::GetList(array(), array('IBLOCK_ID' => $iblockId1), false, array('nTopCount' => 10));
     $bFound = 0;
     while ($aItem = $dbRes->Fetch()) {
         $helper->Iblock()->deleteElement($aItem['ID']);
         $this->out('deleted %d', $aItem['ID']);
         $bFound++;
     }
     if ($bFound) {
         $this->restart();
     }
 }