-
Notifications
You must be signed in to change notification settings - Fork 1
/
contact-checker.php
76 lines (65 loc) · 3.5 KB
/
contact-checker.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
<?php
/*
* Copyright (C) 2022 SYSTOPIA GmbH
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU Affero General Public License as published by
* the Free Software Foundation in version 3.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Affero General Public License for more details.
*
* You should have received a copy of the GNU Affero General Public License
* along with this program. If not, see <http:https://www.gnu.org/licenses/>.
*/
declare(strict_types = 1);
// phpcs:disable Drupal.Commenting.DocComment.ContentAfterOpen
/** @var \Symfony\Component\DependencyInjection\ContainerBuilder $container */
use Civi\Funding\Contact\Relation\RelationTypeContainer;
use Civi\Funding\Contact\Relation\RelationTypeInterface;
use Civi\Funding\DependencyInjection\Util\ServiceRegistrator;
use Civi\Funding\Permission\ContactRelation\ContactRelationCheckerCollection;
use Civi\Funding\Permission\ContactRelation\ContactRelationCheckerInterface;
use Civi\Funding\Permission\ContactRelation\ContactRelationLoaderCollection;
use Civi\Funding\Permission\ContactRelation\ContactRelationLoaderInterface;
use Symfony\Component\DependencyInjection\Argument\TaggedIteratorArgument;
use Symfony\Component\DependencyInjection\Reference;
$container->autowire(\Civi\Funding\Api4\Action\FundingCaseContactRelationType\GetFieldsAction::class);
$container->autowire(\Civi\Funding\Api4\Action\FundingCaseContactRelationType\GetAction::class)
->setArgument('$relationTypeContainer', new Reference('funding.permission.contact_relation_type_container'))
->setPublic(TRUE)
->setShared(TRUE);
$container->autowire(\Civi\Funding\Api4\Action\FundingProgramContactRelationType\GetFieldsAction::class);
$container->autowire(\Civi\Funding\Api4\Action\FundingProgramContactRelationType\GetAction::class)
->setArgument('$relationTypeContainer', new Reference('funding.permission.contact_relation_type_container'))
->setPublic(TRUE)
->setShared(TRUE);
$container->register('funding.permission.contact_relation_type_container', RelationTypeContainer::class)
->addArgument(new TaggedIteratorArgument('funding.permission.contact_relation_type'));
ServiceRegistrator::autowireAllImplementing(
$container,
__DIR__ . '/../Civi/Funding/Permission/ContactRelation/Types',
'Civi\\Funding\\Permission\\ContactRelation\\Types',
RelationTypeInterface::class,
['funding.permission.contact_relation_type' => []],
);
$container->register(ContactRelationCheckerInterface::class, ContactRelationCheckerCollection::class)
->addArgument(new TaggedIteratorArgument('funding.permission.contact_relation_checker'));
ServiceRegistrator::autowireAllImplementing(
$container,
__DIR__ . '/../Civi/Funding/Permission/ContactRelation/Checker',
'Civi\\Funding\\Permission\\ContactRelation\\Checker',
ContactRelationCheckerInterface::class,
['funding.permission.contact_relation_checker' => []],
);
$container->register(ContactRelationLoaderInterface::class, ContactRelationLoaderCollection::class)
->addArgument(new TaggedIteratorArgument('funding.permission.contact_relation_loader'));
ServiceRegistrator::autowireAllImplementing(
$container,
__DIR__ . '/../Civi/Funding/Permission/ContactRelation/Loader',
'Civi\\Funding\\Permission\\ContactRelation\\Loader',
ContactRelationLoaderInterface::class,
['funding.permission.contact_relation_loader' => []],
);