1C-Bitrix 25.700.0
Загрузка...
Поиск...
Не найдено
durationdatebased.php
См. документацию.
1<?php
8namespace Bitrix\Sender\Dispatch;
9
10use Bitrix\Main\Localization\Loc;
11
12use Bitrix\Main\Type\DateTime;
13use Bitrix\Sender\Entity;
14
15Loc::loadMessages(__FILE__);
16
22{
24 private $letter;
25
31 public function __construct(Entity\Letter $letter)
32 {
33 $this->letter = $letter;
34 }
35
42 public function getInterval($count)
43 {
44 $sent = $this->letter->getCounter()->getSent();
45 if (!$sent)
46 {
47 return 0;
48 }
49
50 return ceil(($this->getElapsedInterval() / $sent) * $count);
51 }
52
58 private function getElapsedInterval()
59 {
61 $start = $this->letter->get('DATE_SEND');
62 if (!$start)
63 {
64 return 0;
65 }
66
67 $now = new DateTime;
68 return $now->getTimestamp() - $start->getTimestamp();
69 }
70}
$count
Определения admin_tab.php:4
getTimestamp()
Определения date.php:218
__construct(Entity\Letter $letter)
Определения durationdatebased.php:31
$start
Определения get_search.php:9
Определения ufield.php:9