diff --git a/CRM/Campaign/DAO/Survey.php b/CRM/Campaign/DAO/Survey.php index b46e6235c0b676e44a78e005b91909faeba9b60e..bc051c862cde889ed1e68faf57ba3fb81964ea9e 100644 --- a/CRM/Campaign/DAO/Survey.php +++ b/CRM/Campaign/DAO/Survey.php @@ -6,7 +6,7 @@ * * Generated from xml/schema/CRM/Campaign/Survey.xml * DO NOT EDIT. Generated by CRM_Core_CodeGen - * (GenCodeChecksum:45c10db72afe877c41ddb78b79153648) + * (GenCodeChecksum:8fec5a0ffb4667af4f00820de74aa577) */ /** @@ -474,6 +474,13 @@ class CRM_Campaign_DAO_Survey extends CRM_Core_DAO { 'entity' => 'Survey', 'bao' => 'CRM_Campaign_BAO_Survey', 'localizable' => 0, + 'pseudoconstant' => [ + 'table' => 'civicrm_option_group', + 'keyColumn' => 'id', + 'labelColumn' => 'title', + 'nameColumn' => 'name', + 'condition' => 'name LIKE "civicrm_survey_%"', + ], 'add' => '3.3', ], 'bypass_confirm' => [ diff --git a/Civi/Api4/Survey.php b/Civi/Api4/Survey.php new file mode 100644 index 0000000000000000000000000000000000000000..c4cb0d433f5e366301bcd00cf7e62d4bdfee8d8f --- /dev/null +++ b/Civi/Api4/Survey.php @@ -0,0 +1,23 @@ +<?php +/* + +--------------------------------------------------------------------+ + | Copyright CiviCRM LLC. All rights reserved. | + | | + | This work is published under the GNU AGPLv3 license with some | + | permitted exceptions and without any warranty. For full license | + | and copyright information, see https://civicrm.org/licensing | + +--------------------------------------------------------------------+ + */ +namespace Civi\Api4; + +/** + * Survey entity. + * + * @see https://docs.civicrm.org/user/en/latest/survey/what-is-civisurvey/ + * @searchable secondary + * @since 5.43 + * @package Civi\Api4 + */ +class Survey extends Generic\DAOEntity { + +} diff --git a/tests/phpunit/api/v3/SyntaxConformanceTest.php b/tests/phpunit/api/v3/SyntaxConformanceTest.php index d5917363950a5a78e0e17834be34011ce65eec5e..b9d496bb9480c41b7618046cbe6d548bbf40f9c7 100644 --- a/tests/phpunit/api/v3/SyntaxConformanceTest.php +++ b/tests/phpunit/api/v3/SyntaxConformanceTest.php @@ -538,6 +538,8 @@ class api_v3_SyntaxConformanceTest extends CiviUnitTestCase { 'Logging', // Skip message template because workflow_id/workflow_name are sync'd. 'MessageTemplate', + // Skip survey because the pseudoconstant will have no options. + 'Survey', ]; if ($sequential === TRUE) { return $entitiesWithout; diff --git a/xml/schema/Campaign/Survey.xml b/xml/schema/Campaign/Survey.xml index e57a3b1f4def2e7683be1cfe42d67502932790dc..0433f898b57cbe3ade2d90fe781bdee570803942 100644 --- a/xml/schema/Campaign/Survey.xml +++ b/xml/schema/Campaign/Survey.xml @@ -214,6 +214,13 @@ <default>NULL</default> <comment>Used to store option group id.</comment> <add>3.3</add> + <pseudoconstant> + <table>civicrm_option_group</table> + <keyColumn>id</keyColumn> + <labelColumn>title</labelColumn> + <nameColumn>name</nameColumn> + <condition>name LIKE "civicrm_survey_%"</condition> + </pseudoconstant> </field> <field> <name>bypass_confirm</name>