Add 'readonly' attribute to schema fields
[civicrm-core.git] / Civi / Api4 / Generic / BasicGetFieldsAction.php
index 7f4faf7ae9885ea7d6831403b13b5b01e2b2832c..49af587ffb2dfe5beb53257cff2ba71187225909 100644 (file)
@@ -125,6 +125,7 @@ class BasicGetFieldsAction extends BasicGetAction {
         'title' => empty($field['name']) ? NULL : ucwords(str_replace('_', ' ', $field['name'])),
         'entity' => $this->getEntityName(),
         'required' => FALSE,
+        'readonly' => FALSE,
         'options' => !empty($field['pseudoconstant']),
         'data_type' => \CRM_Utils_Array::value('type', $field, 'String'),
       ], array_flip($fields));
@@ -295,6 +296,10 @@ class BasicGetFieldsAction extends BasicGetAction {
         'name' => 'entity',
         'data_type' => 'String',
       ],
+      [
+        'name' => 'readonly',
+        'data_type' => 'Boolean',
+      ],
     ];
   }