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 | * | |
0493ec47 CW |
27 | * @see \Civi\Api4\Generic\AbstractEntity |
28 | * | |
19b53e5b C |
29 | * @package Civi\Api4 |
30 | */ | |
31 | class Entity extends Generic\AbstractEntity { | |
32 | ||
33 | /** | |
34 | * @return Action\Entity\Get | |
35 | */ | |
36 | public static function get() { | |
37 | return new Action\Entity\Get('Entity', __FUNCTION__); | |
38 | } | |
39 | ||
40 | /** | |
41 | * @return \Civi\Api4\Generic\BasicGetFieldsAction | |
42 | */ | |
43 | public static function getFields() { | |
44 | return new \Civi\Api4\Generic\BasicGetFieldsAction('Entity', __FUNCTION__, function() { | |
45 | return [ | |
f827fe49 CW |
46 | [ |
47 | 'name' => 'name', | |
48 | 'description' => 'Entity name', | |
49 | ], | |
50 | [ | |
51 | 'name' => 'description', | |
52 | 'description' => 'Description from docblock', | |
53 | ], | |
54 | [ | |
55 | 'name' => 'comment', | |
56 | 'description' => 'Comments from docblock', | |
57 | ], | |
58 | [ | |
59 | 'name' => 'see', | |
e15f9453 | 60 | 'data_type' => 'Array', |
f827fe49 CW |
61 | 'description' => 'Any @see annotations from docblock', |
62 | ], | |
19b53e5b C |
63 | ]; |
64 | }); | |
65 | } | |
66 | ||
67 | /** | |
68 | * @return Action\Entity\GetLinks | |
69 | */ | |
70 | public static function getLinks() { | |
71 | return new Action\Entity\GetLinks('Entity', __FUNCTION__); | |
72 | } | |
73 | ||
74 | /** | |
75 | * @return array | |
76 | */ | |
77 | public static function permissions() { | |
78 | return [ | |
79 | 'default' => ['access CiviCRM'], | |
80 | ]; | |
81 | } | |
82 | ||
83 | } |