From 6d3a9944399e71b7b888879c0830a4628365b1bc Mon Sep 17 00:00:00 2001 From: Tim Otten Date: Wed, 26 Jun 2024 15:36:08 -0700 Subject: [PATCH] generate:entity should provide empty DAO along with empty BAO --- .../CivixBundle/Command/AddEntityCommand.php | 1 + .../Resources/views/Code/entity-dao.php.php | 18 ++++++++++++++++++ 2 files changed, 19 insertions(+) create mode 100644 src/CRM/CivixBundle/Resources/views/Code/entity-dao.php.php diff --git a/src/CRM/CivixBundle/Command/AddEntityCommand.php b/src/CRM/CivixBundle/Command/AddEntityCommand.php index d055024b..8203b80a 100644 --- a/src/CRM/CivixBundle/Command/AddEntityCommand.php +++ b/src/CRM/CivixBundle/Command/AddEntityCommand.php @@ -116,6 +116,7 @@ protected function execute(InputInterface $input, OutputInterface $output) { if (in_array('4', $apiVersions)) { $ext->builders['api4.php'] = new Template('entity-api4.php.php', $ctx['api4File'], FALSE, Civix::templating()); } + $ext->builders['dao.php'] = new Template('entity-dao.php.php', $ctx['daoClassFile'], FALSE, Civix::templating()); $ext->builders['bao.php'] = new Template('entity-bao.php.php', $ctx['baoClassFile'], FALSE, Civix::templating()); $ext->builders['entity.xml'] = new Template('entity-schema.xml.php', $ctx['schemaFile'], FALSE, Civix::templating()); diff --git a/src/CRM/CivixBundle/Resources/views/Code/entity-dao.php.php b/src/CRM/CivixBundle/Resources/views/Code/entity-dao.php.php new file mode 100644 index 00000000..0f430657 --- /dev/null +++ b/src/CRM/CivixBundle/Resources/views/Code/entity-dao.php.php @@ -0,0 +1,18 @@ + +use _ExtensionUtil as E; + +/** + * DAOs provide an OOP-style facade for reading and writing database records. + * + * DAOs are a primary source for metadata in several versions of CiviCRM (<5.75) + * and are required for some subsystems (such as APIv3). + * + * This stub provides compatibility. It is not intended to be modified in a + * substantive way. However, you may add comments and annotations. + */ +class extends CRM_Core_DAO { + +}