Merge pull request #15649 from JMAConsulting/core-1346
[civicrm-core.git] / Civi / Api4 / Entity.php
1 <?php
2
3 /*
4 +--------------------------------------------------------------------+
5 | Copyright CiviCRM LLC. All rights reserved. |
6 | |
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 |
10 +--------------------------------------------------------------------+
11 */
12
13 /**
14 *
15 * @package CRM
16 * @copyright CiviCRM LLC https://civicrm.org/licensing
17 * $Id$
18 *
19 */
20
21
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 }