api4 - Import CRM/, Civi/, templates/, ang/, css/, js/, xml/menu
[civicrm-core.git] / Civi / Api4 / CustomValue.php
1 <?php
2
3 namespace Civi\Api4;
4
5 /**
6 * CustomGroup entity.
7 *
8 * @package Civi\Api4
9 */
10 class CustomValue extends Generic\AbstractEntity {
11
12 /**
13 * @param string $customGroup
14 * @return Action\CustomValue\Get
15 */
16 public static function get($customGroup) {
17 return new Action\CustomValue\Get($customGroup, __FUNCTION__);
18 }
19
20 /**
21 * @param string $customGroup
22 * @return Action\CustomValue\GetFields
23 */
24 public static function getFields($customGroup = NULL) {
25 return new Action\CustomValue\GetFields($customGroup, __FUNCTION__);
26 }
27
28 /**
29 * @param string $customGroup
30 * @return Action\CustomValue\Save
31 */
32 public static function save($customGroup) {
33 return new Action\CustomValue\Save($customGroup, __FUNCTION__);
34 }
35
36 /**
37 * @param string $customGroup
38 * @return Action\CustomValue\Create
39 */
40 public static function create($customGroup) {
41 return new Action\CustomValue\Create($customGroup, __FUNCTION__);
42 }
43
44 /**
45 * @param string $customGroup
46 * @return Action\CustomValue\Update
47 */
48 public static function update($customGroup) {
49 return new Action\CustomValue\Update($customGroup, __FUNCTION__);
50 }
51
52 /**
53 * @param string $customGroup
54 * @return Action\CustomValue\Delete
55 */
56 public static function delete($customGroup) {
57 return new Action\CustomValue\Delete($customGroup, __FUNCTION__);
58 }
59
60 /**
61 * @param string $customGroup
62 * @return Action\CustomValue\Replace
63 */
64 public static function replace($customGroup) {
65 return new Action\CustomValue\Replace($customGroup, __FUNCTION__);
66 }
67
68 /**
69 * @param string $customGroup
70 * @return Action\CustomValue\GetActions
71 */
72 public static function getActions($customGroup = NULL) {
73 return new Action\CustomValue\GetActions($customGroup, __FUNCTION__);
74 }
75
76 /**
77 * @inheritDoc
78 */
79 public static function permissions() {
80 $entity = 'contact';
81 $permissions = \CRM_Core_Permission::getEntityActionPermissions();
82
83 // Merge permissions for this entity with the defaults
84 return \CRM_Utils_Array::value($entity, $permissions, []) + $permissions['default'];
85 }
86
87 }