protected $sqlArray;
+ /**
+ * Tables created for the report that need removal afterwards.
+ *
+ * ['civicrm_temp_report_x' => ['temporary' => TRUE, 'name' => 'civicrm_temp_report_x']
+ * @var array
+ */
+ protected $temporaryTables = [];
+
/**
* Can this report use the sql mode ONLY_FULL_GROUP_BY.
* @var bool
return $this->_defaults;
}
+ /**
+ * Remove any temporary tables.
+ */
+ public function cleanUpTemporaryTables() {
+ foreach ($this->temporaryTables as $temporaryTable) {
+ CRM_Core_DAO::executeQuery('DROP ' . ($temporaryTable['temporary'] ? 'TEMPORARY' : '') . ' TABLE IF EXISTS ' . $temporaryTable['name']);
+ }
+ }
+
/**
* Add columns to report.
*/
* (left here in case extensions use it).
*/
public function addAddressFromClause() {
- Civi::log()->warning('Deprecated function addAddressFromClause. Use joinAddressFromContact.', array('civi.tag' => 'deprecated'));
+ CRM_Core_Error::deprecatedFunctionWarning('CRM_Report_Form::joinAddressFromContact');
// include address field if address column is to be included
if ((isset($this->_addressField) &&
$this->_addressField
* (left here in case extensions use it).
*/
public function addPhoneFromClause() {
-
- Civi::log()->warning('Deprecated function addPhoneFromClause. Use joinPhoneFromContact.', array('civi.tag' => 'deprecated'));
+ CRM_Core_Error::deprecatedFunctionWarning('CRM_Report_Form::joinPhoneFromContact');
// include address field if address column is to be included
if ($this->isTableSelected('civicrm_phone')) {
$this->_from .= "
'is_order_bys' => TRUE,
'is_group_bys' => TRUE,
'is_fields' => TRUE,
+ 'is_filters' => TRUE,
),
$options['prefix'] . 'external_identifier' => array(
'name' => 'external_identifier',