Commit 966a3ebc authored by peterh's avatar peterh
Browse files

Now dynamicForeignKeys transfer from Doctrine.

I decided to use a method similar to fields() for transfering the
dynamicForeignKeys from Doctrine to the DAO objects. Really this should
be using the Doctrine @DiscriminatorColumn annotations, but that doesn't
include the refKey information for CRM_Core_Reference_Basic. Since the
goal here is to keep the DAO objects returning exactly the same stuff,
this was the easy way to do that. As we start to implement the mapped
sub classes for these kinds of relationships in Doctrine, maybe we can
change how this works as well.
parent 7ee0f877
......@@ -82,6 +82,9 @@ class CRM_Core_CodeGen_EntitySpecification {
$tables = array();
foreach ($dbXML->tables as $tablesXML) {
foreach ($tablesXML->table as $tableXML) {
if ($this->value('drop', $tableXML, 10000) <= $this->buildVersion) {
continue;
}
if ($this->value('add', $tableXML, 0) <= $this->buildVersion) {
$this->getTable($tableXML, $database, $tables);
}
......
......@@ -473,4 +473,10 @@ class ACL extends \Civi\Core\Entity {
}
return self::$_fields;
}
static function getDynamicReferenceColumns($tableName) {
$dynamic_reference_columns = array();
$dynamic_reference_columns[] = new \CRM_Core_Reference_Dynamic($tableName, 'entity_id', NULL, 'id', 'entity_table');
return $dynamic_reference_columns;
}
}
\ No newline at end of file
......@@ -200,4 +200,9 @@ class Cache extends \Civi\Core\Entity {
}
return self::$_fields;
}
static function getDynamicReferenceColumns($tableName) {
$dynamic_reference_columns = array();
return $dynamic_reference_columns;
}
}
\ No newline at end of file
......@@ -240,4 +240,10 @@ class EntityRole extends \Civi\Core\Entity {
}
return self::$_fields;
}
static function getDynamicReferenceColumns($tableName) {
$dynamic_reference_columns = array();
$dynamic_reference_columns[] = new \CRM_Core_Reference_Dynamic($tableName, 'entity_id', NULL, 'id', 'entity_table');
return $dynamic_reference_columns;
}
}
\ No newline at end of file
......@@ -220,4 +220,4 @@ class DoctrineCrudProvider implements EventSubscriberInterface, ProviderInterfac
public function getApiRegistry() {
return $this->apiRegistry;
}
}
\ No newline at end of file
}
......@@ -1060,4 +1060,9 @@ class Activity extends \Civi\Core\Entity {
}
return self::$_fields;
}
static function getDynamicReferenceColumns($tableName) {
$dynamic_reference_columns = array();
return $dynamic_reference_columns;
}
}
\ No newline at end of file
......@@ -215,4 +215,9 @@ class ActivityContact extends \Civi\Core\Entity {
}
return self::$_fields;
}
static function getDynamicReferenceColumns($tableName) {
$dynamic_reference_columns = array();
return $dynamic_reference_columns;
}
}
\ No newline at end of file
......@@ -716,4 +716,9 @@ class Batch extends \Civi\Core\Entity {
}
return self::$_fields;
}
static function getDynamicReferenceColumns($tableName) {
$dynamic_reference_columns = array();
return $dynamic_reference_columns;
}
}
\ No newline at end of file
......@@ -202,4 +202,10 @@ class EntityBatch extends \Civi\Core\Entity {
}
return self::$_fields;
}
static function getDynamicReferenceColumns($tableName) {
$dynamic_reference_columns = array();
$dynamic_reference_columns[] = new \CRM_Core_Reference_Dynamic($tableName, 'entity_id', NULL, 'id', 'entity_table');
return $dynamic_reference_columns;
}
}
\ No newline at end of file
......@@ -408,4 +408,9 @@ class CCase extends \Civi\Core\Entity {
}
return self::$_fields;
}
static function getDynamicReferenceColumns($tableName) {
$dynamic_reference_columns = array();
return $dynamic_reference_columns;
}
}
\ No newline at end of file
......@@ -166,4 +166,9 @@ class CaseActivity extends \Civi\Core\Entity {
}
return self::$_fields;
}
static function getDynamicReferenceColumns($tableName) {
$dynamic_reference_columns = array();
return $dynamic_reference_columns;
}
}
\ No newline at end of file
......@@ -169,4 +169,9 @@ class CaseContact extends \Civi\Core\Entity {
}
return self::$_fields;
}
static function getDynamicReferenceColumns($tableName) {
$dynamic_reference_columns = array();
return $dynamic_reference_columns;
}
}
\ No newline at end of file
......@@ -354,4 +354,9 @@ class CaseType extends \Civi\Core\Entity {
}
return self::$_fields;
}
static function getDynamicReferenceColumns($tableName) {
$dynamic_reference_columns = array();
return $dynamic_reference_columns;
}
}
\ No newline at end of file
......@@ -764,4 +764,9 @@ class Campaign extends \Civi\Core\Entity {
}
return self::$_fields;
}
static function getDynamicReferenceColumns($tableName) {
$dynamic_reference_columns = array();
return $dynamic_reference_columns;
}
}
\ No newline at end of file
......@@ -252,4 +252,10 @@ class CampaignGroup extends \Civi\Core\Entity {
}
return self::$_fields;
}
static function getDynamicReferenceColumns($tableName) {
$dynamic_reference_columns = array();
$dynamic_reference_columns[] = new \CRM_Core_Reference_Dynamic($tableName, 'entity_id', NULL, 'id', 'entity_table');
return $dynamic_reference_columns;
}
}
\ No newline at end of file
......@@ -823,4 +823,9 @@ class Survey extends \Civi\Core\Entity {
}
return self::$_fields;
}
static function getDynamicReferenceColumns($tableName) {
$dynamic_reference_columns = array();
return $dynamic_reference_columns;
}
}
\ No newline at end of file
......@@ -209,4 +209,9 @@ class ACLContactCache extends \Civi\Core\Entity {
}
return self::$_fields;
}
static function getDynamicReferenceColumns($tableName) {
$dynamic_reference_columns = array();
return $dynamic_reference_columns;
}
}
\ No newline at end of file
......@@ -2336,4 +2336,9 @@ class Contact extends \Civi\Core\Entity {
}
return self::$_fields;
}
static function getDynamicReferenceColumns($tableName) {
$dynamic_reference_columns = array();
return $dynamic_reference_columns;
}
}
\ No newline at end of file
......@@ -357,4 +357,9 @@ class ContactType extends \Civi\Core\Entity {
}
return self::$_fields;
}
static function getDynamicReferenceColumns($tableName) {
$dynamic_reference_columns = array();
return $dynamic_reference_columns;
}
}
\ No newline at end of file
......@@ -415,4 +415,9 @@ class DashboardContact extends \Civi\Core\Entity {
}
return self::$_fields;
}
static function getDynamicReferenceColumns($tableName) {
$dynamic_reference_columns = array();
return $dynamic_reference_columns;
}
}
\ No newline at end of file
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment