3 +--------------------------------------------------------------------+
5 +--------------------------------------------------------------------+
6 | Copyright CiviCRM LLC (c) 2004-2018 |
7 +--------------------------------------------------------------------+
8 | This file is a part of CiviCRM. |
10 | CiviCRM is free software; you can copy, modify, and distribute it |
11 | under the terms of the GNU Affero General Public License |
12 | Version 3, 19 November 2007 and the CiviCRM Licensing Exception. |
14 | CiviCRM is distributed in the hope that it will be useful, but |
15 | WITHOUT ANY WARRANTY; without even the implied warranty of |
16 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. |
17 | See the GNU Affero General Public License for more details. |
19 | You should have received a copy of the GNU Affero General Public |
20 | License and the CiviCRM Licensing Exception along |
21 | with this program; if not, contact CiviCRM LLC |
22 | at info[AT]civicrm[DOT]org. If you have questions about the |
23 | GNU Affero General Public License or the licensing of CiviCRM, |
24 | see the CiviCRM license FAQ at http://civicrm.org/licensing |
25 +--------------------------------------------------------------------+
31 * @copyright CiviCRM LLC (c) 2004-2018
35 * Class CRM_Export_BAO_ExportProcessor
37 * Class to handle logic of export.
39 class CRM_Export_BAO_ExportProcessor
{
49 protected $exportMode;
52 * CRM_Export_BAO_ExportProcessor constructor.
54 * @param int $exportMode
56 public function __construct($exportMode) {
57 $this->setExportMode($exportMode);
58 $this->setQueryMode();
64 public function getQueryMode() {
65 return $this->queryMode
;
69 * Set the query mode based on the export mode.
71 public function setQueryMode() {
73 switch ($this->getExportMode()) {
74 case CRM_Export_Form_Select
::CONTRIBUTE_EXPORT
:
75 $this->queryMode
= CRM_Contact_BAO_Query
::MODE_CONTRIBUTE
;
78 case CRM_Export_Form_Select
::EVENT_EXPORT
:
79 $this->queryMode
= CRM_Contact_BAO_Query
::MODE_EVENT
;
82 case CRM_Export_Form_Select
::MEMBER_EXPORT
:
83 $this->queryMode
= CRM_Contact_BAO_Query
::MODE_MEMBER
;
86 case CRM_Export_Form_Select
::PLEDGE_EXPORT
:
87 $this->queryMode
= CRM_Contact_BAO_Query
::MODE_PLEDGE
;
90 case CRM_Export_Form_Select
::CASE_EXPORT
:
91 $this->queryMode
= CRM_Contact_BAO_Query
::MODE_CASE
;
94 case CRM_Export_Form_Select
::GRANT_EXPORT
:
95 $this->queryMode
= CRM_Contact_BAO_Query
::MODE_GRANT
;
98 case CRM_Export_Form_Select
::ACTIVITY_EXPORT
:
99 $this->queryMode
= CRM_Contact_BAO_Query
::MODE_ACTIVITY
;
103 $this->queryMode
= CRM_Contact_BAO_Query
::MODE_CONTACTS
;
110 public function getExportMode() {
111 return $this->exportMode
;
115 * @param int $exportMode
117 public function setExportMode($exportMode) {
118 $this->exportMode
= $exportMode;