1C-Bitrix 25.700.0
Загрузка...
Поиск...
Не найдено
StepDurations.php
См. документацию.
1<?php
2
3namespace Bitrix\Bizproc\Api\Data\WorkflowFacesService;
4
5use Bitrix\Bizproc\UI\Helpers\DurationFormatter;
6
7final class StepDurations
8{
9 public readonly int $authorDuration;
10 public readonly int $runningDuration;
11 public readonly int $completedDuration;
12 public readonly int $doneDuration;
13
14 public function __construct(int $author, int $running, int $completed, int $done)
15 {
16 $this->authorDuration = max($author, 0);
17 $this->runningDuration = max($running, 0);
18 $this->completedDuration = max($completed, 0);
19 $this->doneDuration = max($done, 0);
20 }
21
22 public function getRoundedAuthorDuration(): int
23 {
24 return $this->getRoundedDuration($this->authorDuration);
25 }
26
27 public function getRoundedRunningDuration(): int
28 {
29 return $this->getRoundedDuration($this->runningDuration);
30 }
31
32 public function getRoundedCompletedDuration(): int
33 {
34 return $this->getRoundedDuration($this->completedDuration);
35 }
36
37 public function getRoundedDoneDuration(): int
38 {
39 return $this->getRoundedDuration($this->doneDuration);
40 }
41
42 public function getRoundedDuration(int $durationInSeconds): int
43 {
44 return DurationFormatter::roundTimeInSeconds($durationInSeconds);
45 }
46}
getRoundedDuration(int $durationInSeconds)
Определения StepDurations.php:42
__construct(int $author, int $running, int $completed, int $done)
Определения StepDurations.php:14
static roundTimeInSeconds(int $timeInSeconds, int $meaningUnit=1)
Определения DurationFormatter.php:21