| 1 | <?php |
| 2 | |
| 3 | namespace Civi\Api4; |
| 4 | |
| 5 | /** |
| 6 | * Retrieves information about all Api4 entities. |
| 7 | * |
| 8 | * @package Civi\Api4 |
| 9 | */ |
| 10 | class Entity extends Generic\AbstractEntity { |
| 11 | |
| 12 | /** |
| 13 | * @return Action\Entity\Get |
| 14 | */ |
| 15 | public static function get() { |
| 16 | return new Action\Entity\Get('Entity', __FUNCTION__); |
| 17 | } |
| 18 | |
| 19 | /** |
| 20 | * @return \Civi\Api4\Generic\BasicGetFieldsAction |
| 21 | */ |
| 22 | public static function getFields() { |
| 23 | return new \Civi\Api4\Generic\BasicGetFieldsAction('Entity', __FUNCTION__, function() { |
| 24 | return [ |
| 25 | ['name' => 'name'], |
| 26 | ['name' => 'description'], |
| 27 | ['name' => 'comment'], |
| 28 | ]; |
| 29 | }); |
| 30 | } |
| 31 | |
| 32 | /** |
| 33 | * @return Action\Entity\GetLinks |
| 34 | */ |
| 35 | public static function getLinks() { |
| 36 | return new Action\Entity\GetLinks('Entity', __FUNCTION__); |
| 37 | } |
| 38 | |
| 39 | /** |
| 40 | * @return array |
| 41 | */ |
| 42 | public static function permissions() { |
| 43 | return [ |
| 44 | 'default' => ['access CiviCRM'], |
| 45 | ]; |
| 46 | } |
| 47 | |
| 48 | } |