Skip to content

Commit

Permalink
Set, don't pass queryOperator
Browse files Browse the repository at this point in the history
  • Loading branch information
eileenmcnaughton committed Jul 16, 2018
1 parent 130d6a0 commit fd46bb9
Show file tree
Hide file tree
Showing 2 changed files with 37 additions and 15 deletions.
4 changes: 2 additions & 2 deletions CRM/Export/BAO/Export.php
Original file line number Diff line number Diff line change
Expand Up @@ -353,7 +353,7 @@ public static function exportComponents(
$queryOperator = 'AND'
) {

$processor = new CRM_Export_BAO_ExportProcessor($exportMode);
$processor = new CRM_Export_BAO_ExportProcessor($exportMode, $queryOperator);
$returnProperties = array();
$paymentFields = $selectedPaymentFields = FALSE;

Expand Down Expand Up @@ -556,7 +556,7 @@ public static function exportComponents(
CRM_Contact_BAO_ProximityQuery::fixInputParams($params);
}

list($query, $select, $from, $where, $having) = $processor->runQuery($params, $order, $queryOperator, $returnProperties);
list($query, $select, $from, $where, $having) = $processor->runQuery($params, $order, $returnProperties);

if ($mergeSameHousehold == 1) {
if (empty($returnProperties['id'])) {
Expand Down
48 changes: 35 additions & 13 deletions CRM/Export/BAO/ExportProcessor.php
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,39 @@ class CRM_Export_BAO_ExportProcessor {
*/
protected $queryFields = [];

/**
* Either AND or OR.
*
* @var string
*/
protected $queryOperator;

/**
* CRM_Export_BAO_ExportProcessor constructor.
*
* @param int $exportMode
* @param string $queryOperator
*/
public function __construct($exportMode, $queryOperator) {
$this->setExportMode($exportMode);
$this->setQueryMode();
$this->setQueryOperator($queryOperator);
}

/**
* @return string
*/
public function getQueryOperator() {
return $this->queryOperator;
}

/**
* @param string $queryOperator
*/
public function setQueryOperator($queryOperator) {
$this->queryOperator = $queryOperator;
}

/**
* @return array
*/
Expand All @@ -69,16 +102,6 @@ public function setQueryFields($queryFields) {
$this->queryFields = $queryFields;
}

/**
* CRM_Export_BAO_ExportProcessor constructor.
*
* @param int $exportMode
*/
public function __construct($exportMode) {
$this->setExportMode($exportMode);
$this->setQueryMode();
}

/**
* @return int
*/
Expand Down Expand Up @@ -142,14 +165,13 @@ public function setExportMode($exportMode) {
/**
* @param $params
* @param $order
* @param $queryOperator
* @param $returnProperties
* @return array
*/
public function runQuery($params, $order, $queryOperator, $returnProperties) {
public function runQuery($params, $order, $returnProperties) {
$query = new CRM_Contact_BAO_Query($params, $returnProperties, NULL,
FALSE, FALSE, $this->getQueryMode(),
FALSE, TRUE, TRUE, NULL, $queryOperator
FALSE, TRUE, TRUE, NULL, $this->getQueryOperator()
);

//sort by state
Expand Down

0 comments on commit fd46bb9

Please sign in to comment.