1C-Bitrix 25.700.0
Загрузка...
Поиск...
Не найдено
Condition.php
См. документацию.
1<?php
2
4
12
14{
15 private readonly ConditionRepository $conditionRepository;
16
17 public function __construct(Request $request = null)
18 {
19 parent::__construct($request);
20 $this->conditionRepository = new ConditionRepository();
21 }
22
23 public function getAutoWiredParameters(): array
24 {
25 return [
27 ConditionDto::class,
28 'conditionDto',
29 function(string $className, int $groupId, string $module, string $event): ConditionDto
30 {
31 return new ConditionDto(
32 module: $module,
33 event: $event,
34 userId: (int)CurrentUser::get()?->getId(),
35 groupId: $groupId,
36 );
37 }
38 ),
39 ];
40 }
41
42 protected function getDefaultPreFilters(): array
43 {
44 return array_merge(
45 parent::getDefaultPreFilters(),
46 [
48 ]
49 );
50 }
51
52 public function addAction(ConditionDto $conditionDto): ?array
53 {
54 $result = $this->conditionRepository->add($conditionDto);
55 if ($result->isSuccess())
56 {
57 return [
58 'id' => $result->id,
59 ];
60 }
61
62 $this->addErrors($result->getErrors());
63
64 return null;
65 }
66
67 public function deleteAction(ConditionDto $conditionDto): array
68 {
69 $this->conditionRepository->deleteByDto($conditionDto);
70
71 return ['result' => true];
72 }
73}
if(!Loader::includeModule('catalog')) if(!AccessController::getCurrent() ->check(ActionDictionary::ACTION_PRICE_EDIT)) if(!check_bitrix_sessid()) $request
Определения catalog_reindex.php:36
__construct(Request $request=null)
Определения Condition.php:17
addAction(ConditionDto $conditionDto)
Определения Condition.php:52
deleteAction(ConditionDto $conditionDto)
Определения Condition.php:67
Определения request.php:10
</td ></tr ></table ></td ></tr >< tr >< td class="bx-popup-label bx-width30"><?=GetMessage("PAGE_NEW_TAGS")?> array( $site)
Определения file_new.php:804
$result
Определения get_property_values.php:14
$event
Определения prolog_after.php:141