Add @searchable annotation to denote which API entities should be visible in Search...
[civicrm-core.git] / ext / afform / core / Civi / Api4 / AfformPalette.php
CommitLineData
f9a6cd03
TO
1<?php
2
3namespace Civi\Api4;
4
f9a6cd03
TO
5/**
6 * Class AfformPalette
09815e9c 7 * @searchable false
f9a6cd03
TO
8 * @package Civi\Api4
9 */
c847b30c 10class AfformPalette extends Generic\AbstractEntity {
f9a6cd03
TO
11
12 /**
c847b30c
CW
13 * @param bool $checkPermissions
14 * @return Generic\BasicGetAction
f9a6cd03 15 */
c847b30c
CW
16 public static function get($checkPermissions = TRUE) {
17 return (new Generic\BasicGetAction('AfformPalette', __FUNCTION__, function() {
f9a6cd03
TO
18 return [
19 [
20 'id' => 'Parent:afl-name',
21 'entity' => 'Parent',
22 'title' => 'Name',
23 'template' => '<afl-name contact-id="entities.parent.id" afl-label="Name"/>',
24 ],
25 [
26 'id' => 'Parent:afl-address',
27 'entity' => 'Parent',
28 'title' => 'Address',
29 'template' => '<afl-address contact-id="entities.parent.id" afl-label="Address"/>',
30 ],
31 ];
c847b30c 32 }))->setCheckPermissions($checkPermissions);
f9a6cd03
TO
33 }
34
c847b30c
CW
35 /**
36 * @param bool $checkPermissions
37 * @return Generic\BasicGetFieldsAction
38 */
39 public static function getFields($checkPermissions = TRUE) {
40 return (new Generic\BasicGetFieldsAction('AfformPalette', __FUNCTION__, function() {
15b11f47
CW
41 return [
42 [
43 'name' => 'id',
44 ],
45 [
46 'name' => 'entity',
47 ],
48 [
49 'name' => 'title',
50 ],
51 [
52 'name' => 'template',
53 ],
54 ];
c847b30c 55 }))->setCheckPermissions($checkPermissions);
15b11f47
CW
56 }
57
f9a6cd03
TO
58 /**
59 * @return array
60 */
61 public static function permissions() {
62 return [
63 "meta" => ["access CiviCRM"],
64 "default" => ["administer CiviCRM"],
65 ];
66 }
67
68}