• Модуль: mail
  • Путь к файлу: ~/bitrix/modules/mail/lib/helper/mailbox.php
  • Класс: BitrixMailHelperMailbox
  • Вызов: Mailbox::activateSync
public function activateSync()
{
	$options = $this->mailbox['OPTIONS'];

	if (!isset($options['activateSync']) || $options['activateSync'] === true)
	{
		return false;
	}

	$entity = MailboxTable::getEntity();
	$connection = $entity->getConnection();

	$options['activateSync'] = true;

	$query = sprintf(
		'UPDATE %s SET %s WHERE %s',
		$connection->getSqlHelper()->quote($entity->getDbTableName()),
		$connection->getSqlHelper()->prepareUpdate($entity->getDbTableName(), [
			'SYNC_LOCK' => 0,
			'OPTIONS'   => serialize($options),
		])[0],
		Query::buildFilterSql(
			$entity,
			[
				'ID' => $this->mailbox['ID']
			]
		)
	);

	return $connection->query($query);
}