X-Git-Url: https://vcs.fsf.org/?a=blobdiff_plain;f=CRM%2FCore%2FBAO%2FCustomQuery.php;h=512b7595c4d85899d70025da6a330e9981648dce;hb=c15fb38374462a40d704d83fac983412df8a16a1;hp=35fee5df4c0a2c3ff723ee1876c1b7af5f1ab41d;hpb=c6e262c51134924a9cc023dcb0613238fd1d0451;p=civicrm-core.git diff --git a/CRM/Core/BAO/CustomQuery.php b/CRM/Core/BAO/CustomQuery.php index 35fee5df4c..512b7595c4 100644 --- a/CRM/Core/BAO/CustomQuery.php +++ b/CRM/Core/BAO/CustomQuery.php @@ -1,10 +1,9 @@ 'civicrm_contact', @@ -131,7 +129,7 @@ class CRM_Core_BAO_CustomQuery { ); /** - * Class constructor + * Class constructor. * * Takes in a set of custom field ids andsets up the data structures to * generate a query @@ -255,11 +253,9 @@ SELECT label, value } /** - * Generate the select clause and the associated tables + * Generate the select clause and the associated tables. * for the from clause * - * @param NULL - * * @return void */ public function select() { @@ -322,11 +318,9 @@ SELECT label, value } /** - * Generate the where clause and also the english language + * Generate the where clause and also the english language. * equivalent * - * @param NULL - * * @return void */ public function where() { @@ -359,7 +353,7 @@ SELECT label, value $wildcard = $isSerialized ? $wildcard : TRUE; $options = CRM_Utils_Array::value('values', civicrm_api3('contact', 'getoptions', array( 'field' => $name, - 'context' => 'search' + 'context' => 'search', ), array())); $qillValue = ''; $sqlOP = $wildcard ? ' OR ' : ' AND '; @@ -488,7 +482,7 @@ SELECT label, value $toValue = CRM_Utils_Array::value('to', $value); if (!$fromValue && !$toValue) { - if (!CRM_Utils_Date::processDate($value) && $op != 'IS NULL' && $op != 'IS NOT NULL') { + if (!CRM_Utils_Date::processDate($value) && !in_array($op, array('IS NULL', 'IS NOT NULL', 'IS EMPTY', 'IS NOT EMPTY'))) { continue; } @@ -554,11 +548,9 @@ SELECT label, value } /** - * Function that does the actual query generation + * Function that does the actual query generation. * basically ties all the above functions together * - * @param NULL - * * @return array * array of strings */ @@ -625,4 +617,5 @@ SELECT label, value $this->_qill[$grouping][] = $label . ' - ' . implode(' ' . ts('and') . ' ', $qill); } } + }