projects
/
civicrm-core.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
INFRA-132 - CRM/Core - phpcbf
[civicrm-core.git]
/
CRM
/
Core
/
BAO
/
CustomQuery.php
diff --git
a/CRM/Core/BAO/CustomQuery.php
b/CRM/Core/BAO/CustomQuery.php
index 8ca162022e06eefdfc34576835a797f4a35be9db..b36e4daf0a7a322ec097c26e35e0fe5a71b3af33 100644
(file)
--- a/
CRM/Core/BAO/CustomQuery.php
+++ b/
CRM/Core/BAO/CustomQuery.php
@@
-2,7
+2,7
@@
/*
+--------------------------------------------------------------------+
/*
+--------------------------------------------------------------------+
- | CiviCRM version 4.
5
|
+ | CiviCRM version 4.
6
|
+--------------------------------------------------------------------+
| Copyright CiviCRM LLC (c) 2004-2014 |
+--------------------------------------------------------------------+
+--------------------------------------------------------------------+
| Copyright CiviCRM LLC (c) 2004-2014 |
+--------------------------------------------------------------------+
@@
-35,24
+35,24
@@
*
*/
class CRM_Core_BAO_CustomQuery {
*
*/
class CRM_Core_BAO_CustomQuery {
-
CONST
PREFIX = 'custom_value_';
+
const
PREFIX = 'custom_value_';
/**
/**
- *
t
he set of custom field ids
+ *
T
he set of custom field ids
*
* @var array
*/
protected $_ids;
/**
*
* @var array
*/
protected $_ids;
/**
- *
t
he select clause
+ *
T
he select clause
*
* @var array
*/
public $_select;
/**
*
* @var array
*/
public $_select;
/**
- *
t
he name of the elements that are in the select clause
+ *
T
he name of the elements that are in the select clause
* used to extract the values
*
* @var array
* used to extract the values
*
* @var array
@@
-60,7
+60,7
@@
class CRM_Core_BAO_CustomQuery {
public $_element;
/**
public $_element;
/**
- *
t
he tables involved in the query
+ *
T
he tables involved in the query
*
* @var array
*/
*
* @var array
*/
@@
-68,7
+68,7
@@
class CRM_Core_BAO_CustomQuery {
public $_whereTables;
/**
public $_whereTables;
/**
- *
t
he where clause
+ *
T
he where clause
*
* @var array
*/
*
* @var array
*/
@@
-107,7
+107,6
@@
class CRM_Core_BAO_CustomQuery {
/**
* This stores custom data group types and tables that it extends
*
/**
* This stores custom data group types and tables that it extends
*
- * @todo add comments explaining why survey & campaign are missing from this
* @var array
* @static
*/
* @var array
* @static
*/
@@
-127,22
+126,24
@@
class CRM_Core_BAO_CustomQuery {
'Pledge' => 'civicrm_pledge',
'Grant' => 'civicrm_grant',
'Address' => 'civicrm_address',
'Pledge' => 'civicrm_pledge',
'Grant' => 'civicrm_grant',
'Address' => 'civicrm_address',
+ 'Campaign' => 'civicrm_campaign',
+ 'Survey' => 'civicrm_survey',
);
/**
);
/**
- *
c
lass constructor
+ *
C
lass constructor
*
* Takes in a set of custom field ids andsets up the data structures to
* generate a query
*
*
* Takes in a set of custom field ids andsets up the data structures to
* generate a query
*
- * @param array $ids the set of custom field ids
+ * @param array $ids
+ * The set of custom field ids.
*
* @param bool $contactSearch
* @param array $locationSpecificFields
*
*
* @param bool $contactSearch
* @param array $locationSpecificFields
*
- * @access public
*/
*/
- function __construct($ids, $contactSearch = FALSE, $locationSpecificFields = array()) {
+
public
function __construct($ids, $contactSearch = FALSE, $locationSpecificFields = array()) {
$this->_ids = &$ids;
$this->_locationSpecificCustomFields = $locationSpecificFields;
$this->_ids = &$ids;
$this->_locationSpecificCustomFields = $locationSpecificFields;
@@
-255,15
+256,14
@@
SELECT label, value
}
/**
}
/**
- *
g
enerate the select clause and the associated tables
+ *
G
enerate the select clause and the associated tables
* for the from clause
*
* for the from clause
*
- * @param
NULL
+ * @param NULL
*
* @return void
*
* @return void
- * @access public
*/
*/
- function select() {
+
public
function select() {
if (empty($this->_fields)) {
return;
}
if (empty($this->_fields)) {
return;
}
@@
-323,16
+323,15
@@
SELECT label, value
}
/**
}
/**
- *
g
enerate the where clause and also the english language
+ *
G
enerate the where clause and also the english language
* equivalent
*
* @param NULL
*
* @return void
*
* equivalent
*
* @param NULL
*
* @return void
*
- * @access public
*/
*/
- function where() {
+
public
function where() {
foreach ($this->_ids as $id => $values) {
// Fixed for Isuue CRM 607
foreach ($this->_ids as $id => $values) {
// Fixed for Isuue CRM 607
@@
-539,6
+538,7
@@
SELECT label, value
case 'IS EMPTY':
$op = 'IS NULL';
break;
case 'IS EMPTY':
$op = 'IS NULL';
break;
+
case 'IS NOT EMPTY':
$op = 'IS NOT NULL';
break;
case 'IS NOT EMPTY':
$op = 'IS NOT NULL';
break;
@@
-553,15
+553,14
@@
SELECT label, value
}
/**
}
/**
- *
f
unction that does the actual query generation
+ *
F
unction that does the actual query generation
* basically ties all the above functions together
*
* @param NULL
*
* @return array array of strings
* basically ties all the above functions together
*
* @param NULL
*
* @return array array of strings
- * @access public
*/
*/
- function query() {
+
public
function query() {
$this->select();
$this->where();
$this->select();
$this->where();
@@
-586,14
+585,14
@@
SELECT label, value
}
/**
}
/**
- * @param $id
+ * @param
int
$id
* @param $label
* @param $type
* @param $label
* @param $type
- * @param $fieldName
+ * @param
string
$fieldName
* @param $value
* @param $grouping
*/
* @param $value
* @param $grouping
*/
- function searchRange(&$id, &$label, $type, $fieldName, &$value, &$grouping) {
+
public
function searchRange(&$id, &$label, $type, $fieldName, &$value, &$grouping) {
$qill = array();
if (isset($value['from'])) {
$qill = array();
if (isset($value['from'])) {