• Модуль: timeman
  • Путь к файлу: ~/bitrix/modules/timeman/lib/service/worktime/violation/worktimeviolationbuilder.php
  • Класс: BitrixTimemanServiceWorktimeViolationWorktimeViolationBuilder
  • Вызов: WorktimeViolationBuilder::createViolation
protected function createViolation($type, $recordedTimeValue = null, $violatedSeconds = null, $userId = null)
{
	$violation = new WorktimeViolation();
	$violation->violationRules = $this->getViolationRules();
	$violation->userId = $userId;
	if (!$violation->userId && $this->getRecord())
	{
		$violation->userId = $this->getRecord()->getUserId();
	}
	$violation->type = $type;
	$violation->recordedTimeValue = $recordedTimeValue;
	$violation->violatedSeconds = $violatedSeconds;
	if ($this->getCreateViolationCallback())
	{
		return call_user_func($this->getCreateViolationCallback(), $violation);
	}
	return $violation;
}