Skip to content
Snippets Groups Projects
Unverified Commit 1acaf363 authored by totten's avatar totten Committed by GitHub
Browse files

Merge pull request #17861 from totten/master-dao-event

EventCart - Resolve BAO identity and uncommitted DAO changes
parents 1074b453 915274c8
Branches
Tags
No related merge requests found
......@@ -192,6 +192,7 @@ class CRM_Core_CodeGen_Specification {
$sourceFile = "xml/schema/{$base}/{$klass}.xml";
$daoPath = "{$base}/DAO/";
$baoPath = __DIR__ . '/../../../' . str_replace(' ', '', "{$base}/BAO/");
$useBao = $this->value('useBao', $tableXML, file_exists($baoPath . $klass . '.php'));
$pre = str_replace('/', '_', $daoPath);
$this->classNames[$name] = $pre . $klass;
......@@ -213,7 +214,7 @@ class CRM_Core_CodeGen_Specification {
'icon' => $tableXML->icon ?? NULL,
'labelName' => substr($name, 8),
'className' => $this->classNames[$name],
'bao' => (file_exists($baoPath . $klass . '.php') ? str_replace('DAO', 'BAO', $this->classNames[$name]) : $this->classNames[$name]),
'bao' => ($useBao ? str_replace('DAO', 'BAO', $this->classNames[$name]) : $this->classNames[$name]),
'entity' => $klass,
'attributes_simple' => trim($database['tableAttributes_simple']),
'attributes_modern' => trim($database['tableAttributes_modern']),
......
......@@ -3,6 +3,7 @@
<table>
<base>CRM/Event/Cart</base>
<class>Cart</class>
<useBao>1</useBao>
<name>civicrm_event_carts</name>
<field>
<name>id</name>
......
......@@ -3,6 +3,7 @@
<table>
<base>CRM/Event/Cart</base>
<class>EventInCart</class>
<useBao>1</useBao>
<name>civicrm_events_in_carts</name>
<field>
<name>id</name>
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment