INFRA-132 - CRM/Core - phpcbf
[civicrm-core.git] / CRM / Core / BAO / CustomQuery.php
index 849c571ca265606292da767e1e08f37b08d4d0fd..b36e4daf0a7a322ec097c26e35e0fe5a71b3af33 100644 (file)
@@ -2,7 +2,7 @@
 
 /*
  +--------------------------------------------------------------------+
- | CiviCRM version 4.5                                                |
+ | CiviCRM version 4.6                                                |
  +--------------------------------------------------------------------+
  | Copyright CiviCRM LLC (c) 2004-2014                                |
  +--------------------------------------------------------------------+
@@ -35,7 +35,7 @@
  *
  */
 class CRM_Core_BAO_CustomQuery {
-  CONST PREFIX = 'custom_value_';
+  const PREFIX = 'custom_value_';
 
   /**
    * The set of custom field ids
@@ -107,7 +107,6 @@ class CRM_Core_BAO_CustomQuery {
   /**
    * 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
    */
@@ -127,6 +126,8 @@ class CRM_Core_BAO_CustomQuery {
     'Pledge' => 'civicrm_pledge',
     'Grant' => 'civicrm_grant',
     'Address' => 'civicrm_address',
+    'Campaign' => 'civicrm_campaign',
+    'Survey' => 'civicrm_survey',
   );
 
   /**
@@ -135,14 +136,14 @@ class CRM_Core_BAO_CustomQuery {
    * 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;
 
@@ -258,12 +259,11 @@ SELECT label, value
    * 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;
     }
@@ -330,9 +330,8 @@ SELECT label, value
    *
    * @return void
    *
-   * @access public
    */
-  function where() {
+  public function where() {
     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 NOT EMPTY':
                   $op = 'IS NOT NULL';
                   break;
@@ -559,9 +559,8 @@ SELECT label, value
    * @param NULL
    *
    * @return  array   array of strings
-   * @access public
    */
-  function query() {
+  public function query() {
     $this->select();
 
     $this->where();
@@ -593,7 +592,7 @@ SELECT label, value
    * @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'])) {