1C-Bitrix 25.700.0
Загрузка...
Поиск...
Не найдено
updatecontactdtofactory.php
См. документацию.
1<?php
2
4
11
13{
14 private DateTime $date;
15
16 private bool $blacklisted;
17
24 public function __construct(bool $blacklisted = false, ?DateTime $date = null)
25 {
26 $this->blacklisted = $blacklisted;
27 $this->date = $date ?? new DateTime();
28 }
29
38 public function make(string $code, ?string $name): ?UpdateContact
39 {
40 $typeId = Type::detect($code);
41 if (!$typeId)
42 {
43 return null;
44 }
45
47 if (!$code)
48 {
49 return null;
50 }
51
52 $item = $this->createDto();
53 $item->typeId = $typeId;
54 $item->code = $code;
55 $item->dateInsert = $this->date;
56 $item->dateUpdate = $this->date;
57 $item->name = $name;
58
59 return $item;
60 }
61
65 public function createDto(): UpdateContact
66 {
67 return $this->blacklisted ? new UpdateBlacklistDTO() : new UpdateContactDTO();
68 }
69}
__construct(bool $blacklisted=false, ?DateTime $date=null)
Определения updatecontactdtofactory.php:24
static normalize($code, $typeId=Type::EMAIL)
Определения normalizer.php:28
if(!is_null($config))($config as $configItem)(! $configItem->isVisible()) $code
Определения options.php:195
$name
Определения menu_edit.php:35
Определения collection.php:2