Skip to content
Snippets Groups Projects
Commit 1361f085 authored by jaapjansma's avatar jaapjansma
Browse files

#2 check if primary data flow is table data flow.

parent 2b55c206
No related branches found
No related tags found
No related merge requests found
...@@ -93,7 +93,13 @@ abstract class AbstractCivicrmEntitySource extends AbstractSource { ...@@ -93,7 +93,13 @@ abstract class AbstractCivicrmEntitySource extends AbstractSource {
} }
$this->addFilters($this->configuration); $this->addFilters($this->configuration);
if (count($this->customGroupDataFlowDescriptions) || count($this->additionalDataFlowDescriptions)) { if (count($this->customGroupDataFlowDescriptions) || count($this->additionalDataFlowDescriptions)) {
$this->dataFlow = new CombinedSqlDataFlow('', $this->primaryDataFlow->getTable(), $this->primaryDataFlow->getTableAlias()); if ($this->primaryDataFlow instanceof CombinedSqlDataFlow) {
$this->dataFlow = new CombinedSqlDataFlow('', $this->primaryDataFlow->getPrimaryTable(), $this->primaryDataFlow->getPrimaryTableAlias());
} elseif ($this->primaryDataFlow instanceof SqlTableDataFlow) {
$this->dataFlow = new CombinedSqlDataFlow('', $this->primaryDataFlow->getTable(), $this->primaryDataFlow->getTableAlias());
} else {
throw new \Exception("Invalid primary data source in data source ".$this->getSourceName());
}
$this->dataFlow->addSourceDataFlow(new DataFlowDescription($this->primaryDataFlow)); $this->dataFlow->addSourceDataFlow(new DataFlowDescription($this->primaryDataFlow));
foreach ($this->additionalDataFlowDescriptions as $additionalDataFlowDescription) { foreach ($this->additionalDataFlowDescriptions as $additionalDataFlowDescription) {
$this->dataFlow->addSourceDataFlow($additionalDataFlowDescription); $this->dataFlow->addSourceDataFlow($additionalDataFlowDescription);
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment