1C-Bitrix
25.700.0
Загрузка...
Поиск...
Не найдено
durationdatebased.php
См. документацию.
1
<?php
8
namespace
Bitrix\Sender\Dispatch;
9
10
use Bitrix\Main\Localization\Loc;
11
12
use Bitrix\Main\Type\DateTime;
13
use Bitrix\Sender\Entity;
14
15
Loc::loadMessages(__FILE__);
16
21
class
DurationDateBased
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
$count
Определения
admin_tab.php:4
Bitrix\Main\Type\Date\getTimestamp
getTimestamp()
Определения
date.php:218
Bitrix\Main\Type\DateTime
Определения
datetime.php:9
Bitrix\Sender\Dispatch\DurationDateBased
Определения
durationdatebased.php:22
Bitrix\Sender\Dispatch\DurationDateBased\__construct
__construct(Entity\Letter $letter)
Определения
durationdatebased.php:31
Bitrix\Sender\Dispatch\DurationDateBased\getInterval
getInterval($count)
Определения
durationdatebased.php:42
Bitrix\Sender\Entity\Letter
Определения
letter.php:36
$start
$start
Определения
get_search.php:9
Bitrix\Main\Entity
Определения
ufield.php:9
bitrix
modules
sender
lib
dispatch
durationdatebased.php
Создано системой
1.14.0