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 | * Retrieves information about all Api4 entities. | |
26 | * | |
27 | * @package Civi\Api4 | |
28 | */ | |
29 | class Entity extends Generic\AbstractEntity { | |
30 | ||
31 | /** | |
32 | * @return Action\Entity\Get | |
33 | */ | |
34 | public static function get() { | |
35 | return new Action\Entity\Get('Entity', __FUNCTION__); | |
36 | } | |
37 | ||
38 | /** | |
39 | * @return \Civi\Api4\Generic\BasicGetFieldsAction | |
40 | */ | |
41 | public static function getFields() { | |
42 | return new \Civi\Api4\Generic\BasicGetFieldsAction('Entity', __FUNCTION__, function() { | |
43 | return [ | |
44 | ['name' => 'name'], | |
45 | ['name' => 'description'], | |
46 | ['name' => 'comment'], | |
47 | ]; | |
48 | }); | |
49 | } | |
50 | ||
51 | /** | |
52 | * @return Action\Entity\GetLinks | |
53 | */ | |
54 | public static function getLinks() { | |
55 | return new Action\Entity\GetLinks('Entity', __FUNCTION__); | |
56 | } | |
57 | ||
58 | /** | |
59 | * @return array | |
60 | */ | |
61 | public static function permissions() { | |
62 | return [ | |
63 | 'default' => ['access CiviCRM'], | |
64 | ]; | |
65 | } | |
66 | ||
67 | } |