1C-Bitrix 25.700.0
Загрузка...
Поиск...
Не найдено
ValidateEventCategoryCreate.php
См. документацию.
1<?php
2
4
10
12{
14 {
15 $request = $this->getAction()->getController()->getRequest();
16 $name = $request->get('name');
17 $nameErrors = CommonEventCategoryValidators::validateName($name);
18 if ($nameErrors)
19 {
20 $this->addErrors($nameErrors);
21 }
22
23 $description = $request->get('description');
24 $descriptionErrors = CommonEventCategoryValidators::validateDescription($description);
25 if ($descriptionErrors)
26 {
27 $this->addErrors($descriptionErrors);
28 }
29
30 $closedRaw = $request->get('closed');
31 $closedErrors = CommonEventCategoryValidators::validateClosed($closedRaw);
32 if ($closedErrors)
33 {
34 $this->addErrors($closedErrors);
35 }
36 $closed = $request->get('closed') === 'true';
37
38 $attendees = $request->get('attendees') ?? [];
39 $attendeesErrors = CommonEventCategoryValidators::validateAttendees($closed, $attendees);
40 if ($attendeesErrors)
41 {
42 $this->addErrors($attendeesErrors);
43 }
44
45 $departmentIds = $request->get('departmentIds') ?? [];
46 $departmentIdsErrors = CommonEventCategoryValidators::validateDepartmentIds($closed, $departmentIds);
47 if (!empty($departmentIdsErrors))
48 {
49 $this->addErrors($departmentIdsErrors);
50 }
51
52 $channel = $request->get('channel');
53 if ($channel && !(int)$channel)
54 {
55 $this->addError(new Error('channel invalid', 'channel_invalid'));
56 }
57
58 if ($this->getErrors())
59 {
60 return new EventResult(type: EventResult::ERROR, handler: $this);
61 }
62
63 return null;
64 }
65
69 protected function addErrors(array $errors): static
70 {
71 array_map(fn (Error $error) => $this->addError($error), $errors);
72
73 return $this;
74 }
75}
if(!Loader::includeModule('catalog')) if(!AccessController::getCurrent() ->check(ActionDictionary::ACTION_PRICE_EDIT)) if(!check_bitrix_sessid()) $request
Определения catalog_reindex.php:36
addError(Error $error)
Определения base.php:80
Определения error.php:15
Определения event.php:5
</td ></tr ></table ></td ></tr >< tr >< td class="bx-popup-label bx-width30"><?=GetMessage("PAGE_NEW_TAGS")?> array( $site)
Определения file_new.php:804
if(Loader::includeModule( 'bitrix24')) elseif(Loader::includeModule('intranet') &&CIntranetUtils::getPortalZone() !=='ru') $description
Определения .description.php:24
$errors
Определения iblock_catalog_edit.php:74
$name
Определения menu_edit.php:35
$event
Определения prolog_after.php:141
$error
Определения subscription_card_product.php:20