Bitrix-D7
23.9
Загрузка...
Поиск...
Не найдено
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
}
Bitrix\Main\Localization\Loc
Definition
loc.php:11
Bitrix\Main\Localization\Loc\loadMessages
static loadMessages($file)
Definition
loc.php:64
Bitrix\Main\ORM\Entity
Definition
entity.php:26
Bitrix\Main\Type\Date\getTimestamp
getTimestamp()
Definition
date.php:215
Bitrix\Main\Type\DateTime
Definition
datetime.php:9
Bitrix\Sender\Dispatch\DurationDateBased
Definition
durationdatebased.php:22
Bitrix\Sender\Dispatch\DurationDateBased\__construct
__construct(Entity\Letter $letter)
Definition
durationdatebased.php:31
Bitrix\Sender\Dispatch\DurationDateBased\getInterval
getInterval($count)
Definition
durationdatebased.php:42
Bitrix\Sender\Entity\Letter
Definition
letter.php:34
Bitrix\Sender\Dispatch
Definition
duration.php:8
Bitrix\Sender\Entity
Definition
ad.php:8
modules
sender
lib
dispatch
durationdatebased.php
Создано системой
1.10.0