1C-Bitrix
25.700.0
Загрузка...
Поиск...
Не найдено
DateTime.php
См. документацию.
1
<?php
2
3
namespace
Bitrix\Im\V2\Message\Param;
4
5
use Bitrix\Im\V2\Message\Param;
6
use Bitrix\Main;
7
8
class
DateTime
extends
Param
9
{
14
public
function
setValue
(
$value
): self
15
{
16
if
(
$value
instanceof
Main
\
Type
\
DateTime
)
17
{
18
$this->value =
$value
;
19
}
20
elseif
(
$value
instanceof \
DateTime
)
21
{
22
$this->value =
Main\Type\DateTime::createFromPhp
(
$value
);
23
}
24
else
25
{
26
$this->value =
Main\Type\DateTime::createFromTimestamp
((
int
)
$value
);
27
}
28
29
return
$this;
30
}
31
35
public
function
getValue
(): ?
Main
\
Type
\
DateTime
36
{
37
if
(!empty($this->value))
38
{
39
if
($this->value instanceof
Main
\
Type
\
DateTime
)
40
{
41
return
$this->value
;
42
}
43
else
44
{
45
return
Main\Type\DateTime::createFromTimestamp
((
int
)$this->value);
46
}
47
}
48
49
return
null
;
50
}
51
55
public
function
toRestFormat
(): ?string
56
{
57
if
($this->
getValue
() instanceof
Main
\
Type
\
DateTime
)
58
{
59
return
$this->
getValue
()->format(
'c'
);
60
}
61
62
return
null
;
63
}
64
69
public
function
saveValueFilter
(
$value
)
70
{
71
if
(
$value
instanceof
Main
\
Type
\
DateTime
)
72
{
73
return
$value
->getTimestamp();
74
}
75
76
return
$value
;
77
}
78
83
public
function
loadValueFilter
(
$value
)
84
{
85
if
(!(
$value
instanceof
Main
\
Type
\
DateTime
))
86
{
87
return
Main\Type\DateTime::createFromTimestamp
((
int
)
$value
);
88
}
89
90
return
$value
;
91
}
92
}
Bitrix\Im\V2\Message\Param\DateTime\setValue
setValue($value)
Определения
DateTime.php:14
Bitrix\Im\V2\Message\Param\DateTime\loadValueFilter
loadValueFilter($value)
Определения
DateTime.php:83
Bitrix\Im\V2\Message\Param\DateTime\getValue
getValue()
Определения
DateTime.php:35
Bitrix\Im\V2\Message\Param\DateTime\saveValueFilter
saveValueFilter($value)
Определения
DateTime.php:69
Bitrix\Im\V2\Message\Param\DateTime\toRestFormat
toRestFormat()
Определения
DateTime.php:55
Bitrix\Im\V2\Message\Param\$value
$value
Определения
Param.php:46
Bitrix\Main\Type\Date\$value
$value
Определения
date.php:11
Bitrix\Main\Type\DateTime
Определения
datetime.php:9
Bitrix\Main\Type\DateTime\createFromTimestamp
static createFromTimestamp($timestamp)
Определения
datetime.php:246
Bitrix\Main\Type\DateTime\createFromPhp
static createFromPhp(\DateTime $datetime)
Определения
datetime.php:232
Bitrix\Im\V2\Chat\Param
Bitrix\Main\Type
Определения
collection.php:2
Bitrix\Main
elseif
if( $daysToExpire >=0 &&$daysToExpire< 60 elseif)( $daysToExpire< 0)
Определения
prolog_main_admin.php:393
bitrix
modules
im
lib
V2
Message
Param
DateTime.php
Создано системой
1.14.0