• Модуль: sender
  • Путь к файлу: ~/bitrix/modules/sender/lib/integration/crm/preset/segment.php
  • Класс: Bitrix\Sender\Integration\Crm\Preset\Segment
  • Вызов: Segment::uninstall
public function uninstall()
{
	$segments = Entity\Segment::getList(array(
		'select' => array('ID'),
		'filter' => array(
			'=IS_SYSTEM' => true,
			'%CODE' => 'crm_%'
		)
	));
	foreach ($segments as $segment)
	{
		if (Entity\Segment::removeById($segment['ID']))
		{
			continue;
		}

		return false;
	}

	return true;
}