Commit | Line | Data |
---|---|---|
19b53e5b C |
1 | <?php |
2 | ||
380f3545 TO |
3 | /* |
4 | +--------------------------------------------------------------------+ | |
41498ac5 | 5 | | Copyright CiviCRM LLC. All rights reserved. | |
380f3545 | 6 | | | |
41498ac5 TO |
7 | | This work is published under the GNU AGPLv3 license with some | |
8 | | permitted exceptions and without any warranty. For full license | | |
9 | | and copyright information, see https://civicrm.org/licensing | | |
380f3545 TO |
10 | +--------------------------------------------------------------------+ |
11 | */ | |
12 | ||
13 | /** | |
14 | * | |
15 | * @package CRM | |
ca5cec67 | 16 | * @copyright CiviCRM LLC https://civicrm.org/licensing |
380f3545 TO |
17 | * $Id$ |
18 | * | |
19 | */ | |
20 | ||
21 | ||
19b53e5b C |
22 | namespace Civi\Api4; |
23 | ||
24 | /** | |
25 | * CustomGroup entity. | |
26 | * | |
27 | * @package Civi\Api4 | |
28 | */ | |
29 | class CustomValue extends Generic\AbstractEntity { | |
30 | ||
31 | /** | |
32 | * @param string $customGroup | |
33 | * @return Action\CustomValue\Get | |
34 | */ | |
35 | public static function get($customGroup) { | |
36 | return new Action\CustomValue\Get($customGroup, __FUNCTION__); | |
37 | } | |
38 | ||
39 | /** | |
40 | * @param string $customGroup | |
41 | * @return Action\CustomValue\GetFields | |
42 | */ | |
43 | public static function getFields($customGroup = NULL) { | |
44 | return new Action\CustomValue\GetFields($customGroup, __FUNCTION__); | |
45 | } | |
46 | ||
47 | /** | |
48 | * @param string $customGroup | |
49 | * @return Action\CustomValue\Save | |
50 | */ | |
51 | public static function save($customGroup) { | |
52 | return new Action\CustomValue\Save($customGroup, __FUNCTION__); | |
53 | } | |
54 | ||
55 | /** | |
56 | * @param string $customGroup | |
57 | * @return Action\CustomValue\Create | |
58 | */ | |
59 | public static function create($customGroup) { | |
60 | return new Action\CustomValue\Create($customGroup, __FUNCTION__); | |
61 | } | |
62 | ||
63 | /** | |
64 | * @param string $customGroup | |
65 | * @return Action\CustomValue\Update | |
66 | */ | |
67 | public static function update($customGroup) { | |
68 | return new Action\CustomValue\Update($customGroup, __FUNCTION__); | |
69 | } | |
70 | ||
71 | /** | |
72 | * @param string $customGroup | |
73 | * @return Action\CustomValue\Delete | |
74 | */ | |
75 | public static function delete($customGroup) { | |
76 | return new Action\CustomValue\Delete($customGroup, __FUNCTION__); | |
77 | } | |
78 | ||
79 | /** | |
80 | * @param string $customGroup | |
81 | * @return Action\CustomValue\Replace | |
82 | */ | |
83 | public static function replace($customGroup) { | |
84 | return new Action\CustomValue\Replace($customGroup, __FUNCTION__); | |
85 | } | |
86 | ||
87 | /** | |
88 | * @param string $customGroup | |
89 | * @return Action\CustomValue\GetActions | |
90 | */ | |
91 | public static function getActions($customGroup = NULL) { | |
92 | return new Action\CustomValue\GetActions($customGroup, __FUNCTION__); | |
93 | } | |
94 | ||
95 | /** | |
96 | * @inheritDoc | |
97 | */ | |
98 | public static function permissions() { | |
99 | $entity = 'contact'; | |
100 | $permissions = \CRM_Core_Permission::getEntityActionPermissions(); | |
101 | ||
102 | // Merge permissions for this entity with the defaults | |
103 | return \CRM_Utils_Array::value($entity, $permissions, []) + $permissions['default']; | |
104 | } | |
105 | ||
106 | } |