3 +--------------------------------------------------------------------+
4 | Copyright CiviCRM LLC. All rights reserved. |
6 | This work is published under the GNU AGPLv3 license with some |
7 | permitted exceptions and without any warranty. For full license |
8 | and copyright information, see https://civicrm.org/licensing |
9 +--------------------------------------------------------------------+
14 * Retrieves information about all Api4 entities.
16 * @see \Civi\Api4\Generic\AbstractEntity
22 class Entity
extends Generic\AbstractEntity
{
25 * @param bool $checkPermissions
26 * @return Action\Entity\Get
28 public static function get($checkPermissions = TRUE) {
29 return (new Action\Entity\
Get('Entity', __FUNCTION__
))
30 ->setCheckPermissions($checkPermissions);
34 * @param bool $checkPermissions
35 * @return Generic\BasicGetFieldsAction
37 public static function getFields($checkPermissions = TRUE) {
38 return (new Generic\
BasicGetFieldsAction('Entity', __FUNCTION__
, function() {
42 'description' => 'Entity name',
46 'description' => 'Localized title (singular)',
49 'name' => 'title_plural',
50 'description' => 'Localized title (plural)',
54 'data_type' => 'Array',
55 'description' => 'Base class for this entity',
57 'AbstractEntity' => 'AbstractEntity',
58 'DAOEntity' => 'DAOEntity',
59 'CustomValue' => 'CustomValue',
60 'BasicEntity' => 'BasicEntity',
61 'SortableEntity' => 'SortableEntity',
62 'ManagedEntity' => 'ManagedEntity',
63 'EntityBridge' => 'EntityBridge',
67 'name' => 'description',
68 'description' => 'Description from docblock',
72 'description' => 'Comments from docblock',
76 'description' => 'crm-i icon class associated with this entity',
80 'description' => 'Class name for dao-based entities',
83 'name' => 'table_name',
84 'description' => 'Name of sql table, if applicable',
87 'name' => 'primary_key',
88 'data_type' => 'Array',
89 'description' => 'Name of unique identifier field(s) (e.g. [id])',
92 'name' => 'label_field',
93 'description' => 'Field to show when displaying a record',
97 'description' => 'Default column to sort results',
100 'name' => 'searchable',
101 'description' => 'How should this entity be presented in search UIs',
103 'primary' => ts('Primary'),
104 'secondary' => ts('Secondary'),
105 'bridge' => ts('Bridge'),
106 'none' => ts('None'),
111 'data_type' => 'Array',
112 'description' => 'System paths for accessing this entity',
116 'data_type' => 'Array',
117 'description' => 'Any @see annotations from docblock',
121 'data_type' => 'String',
122 'description' => 'Version this API entity was added',
126 'data_type' => 'String',
127 'description' => 'PHP class name',
130 'name' => 'class_args',
131 'data_type' => 'Array',
132 'description' => 'Arguments needed by php action factory functions (used when multiple entities share a class, e.g. CustomValue).',
136 'data_type' => 'Array',
137 'description' => 'Connecting fields for EntityBridge types',
140 'name' => 'ui_join_filters',
141 'data_type' => 'Array',
142 'description' => 'When joining entities in the UI, which fields should be presented by default in the ON clause',
145 'name' => 'group_weights_by',
146 'data_type' => 'Array',
147 'description' => 'For sortable entities, what field groupings are used to order by weight',
150 }))->setCheckPermissions($checkPermissions);
154 * @param bool $checkPermissions
156 * @return Action\Entity\GetLinks
158 public static function getLinks($checkPermissions = TRUE) {
159 return (new Action\Entity\
GetLinks('Entity', __FUNCTION__
))
160 ->setCheckPermissions($checkPermissions);
166 public static function permissions() {
168 'default' => ['access CiviCRM'],