• Модуль: tasks
  • Путь к файлу: ~/bitrix/modules/tasks/lib/replicator/replicator.php
  • Класс: BitrixTasksReplicatorReplicator
  • Вызов: Replicator::getProducer
protected function getProducer(): Producer;
abstract protected function getRepeater(): Repeater;
abstract protected function getChecker(): Checker;
abstract protected function getRepository(): Repository;

public function replicate(int $templateId, bool $force = false): string
{
	$this->init($templateId);
	if (!$force && $this->checker->stopReplicationByInvalidData())
	{
		return static::EMPTY_AGENT;
	}

	if (!$force && $this->checker->stopCurrentReplicationByPostpone())
	{
		return static::getAgentName($this->templateId);
	}

	$this->currentResult = $this->producer->produceTask();
	$this->writeToLog();

	$this->currentResult = $this->repeater->repeatTask();
	$this->writeToLog();

	return $this->currentResult->getData()[static::AGENT_NAME_PARAMETER];
}