1C-Bitrix 25.700.0
Загрузка...
Поиск...
Не найдено
DateTime.php
См. документацию.
1<?php
2
3namespace Bitrix\Im\V2\Message\Param;
4
5use Bitrix\Im\V2\Message\Param;
6use Bitrix\Main;
7
8class 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 {
23 }
24 else
25 {
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 {
88 }
89
90 return $value;
91 }
92}
loadValueFilter($value)
Определения DateTime.php:83
saveValueFilter($value)
Определения DateTime.php:69
$value
Определения date.php:11
static createFromTimestamp($timestamp)
Определения datetime.php:246
static createFromPhp(\DateTime $datetime)
Определения datetime.php:232
Определения collection.php:2
if( $daysToExpire >=0 &&$daysToExpire< 60 elseif)( $daysToExpire< 0)
Определения prolog_main_admin.php:393