/*
+--------------------------------------------------------------------+
- | CiviCRM version 4.5 |
+ | CiviCRM version 4.6 |
+--------------------------------------------------------------------+
| Copyright CiviCRM LLC (c) 2004-2014 |
+--------------------------------------------------------------------+
*
*/
class CRM_Core_BAO_CustomQuery {
- CONST PREFIX = 'custom_value_';
+ const PREFIX = 'custom_value_';
/**
* The set of custom field ids
/**
* 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
*/
'Pledge' => 'civicrm_pledge',
'Grant' => 'civicrm_grant',
'Address' => 'civicrm_address',
+ 'Campaign' => 'civicrm_campaign',
+ 'Survey' => 'civicrm_survey',
);
/**
* 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
*
- * @access public
*/
- function __construct($ids, $contactSearch = FALSE, $locationSpecificFields = array()) {
+ public function __construct($ids, $contactSearch = FALSE, $locationSpecificFields = array()) {
$this->_ids = &$ids;
$this->_locationSpecificCustomFields = $locationSpecificFields;
* Generate the select clause and the associated tables
* for the from clause
*
- * @param NULL
+ * @param NULL
*
* @return void
- * @access public
*/
- function select() {
+ public function select() {
if (empty($this->_fields)) {
return;
}
*
* @return void
*
- * @access public
*/
- function where() {
+ public function where() {
foreach ($this->_ids as $id => $values) {
// Fixed for Isuue CRM 607
case 'IS EMPTY':
$op = 'IS NULL';
break;
+
case 'IS NOT EMPTY':
$op = 'IS NOT NULL';
break;
* @param NULL
*
* @return array array of strings
- * @access public
*/
- function query() {
+ public function query() {
$this->select();
$this->where();
* @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'])) {