From a37f134c0039de2fc076d570010e14cddadd3043 Mon Sep 17 00:00:00 2001 From: Tim Otten Date: Thu, 9 Sep 2021 21:17:32 -0700 Subject: [PATCH] ExampleData - Declare the PK field to be 'name'. Add 'type=>Extra' for heavy fields. --- Civi/Api4/ExampleData.php | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/Civi/Api4/ExampleData.php b/Civi/Api4/ExampleData.php index 987581195b..c53f430b1b 100644 --- a/Civi/Api4/ExampleData.php +++ b/Civi/Api4/ExampleData.php @@ -67,12 +67,14 @@ class ExampleData extends \Civi\Api4\Generic\AbstractEntity { ], ], [ + 'type' => 'Extra', 'name' => 'data', 'title' => 'Example data', 'data_type' => 'String', 'serialize' => \CRM_Core_DAO::SERIALIZE_JSON, ], [ + 'type' => 'Extra', 'name' => 'asserts', 'title' => 'Test assertions', 'data_type' => 'String', @@ -93,4 +95,13 @@ class ExampleData extends \Civi\Api4\Generic\AbstractEntity { ]; } + /** + * @inheritDoc + */ + public static function getInfo() { + $info = parent::getInfo(); + $info['primary_key'] = ['name']; + return $info; + } + } -- 2.25.1