INFRA 32 - Batch #17
[civicrm-core.git] / CRM / Contact / BAO / SavedSearch.php
index 96adfce565c5ce0150b72a0fc9739e796ca0f8e1..fe1f399a78e0b01438775f0d5ce8d5b0fe13a631 100644 (file)
@@ -51,8 +51,8 @@ class CRM_Contact_BAO_SavedSearch extends CRM_Contact_DAO_SavedSearch {
   /**
    * Query the db for all saved searches.
    *
-   * @return array $aSavedSearch - contains the search name as value and and id as key
-   *
+   * @return array
+   *   contains the search name as value and and id as key
    */
   public function getAll() {
     $savedSearch = new CRM_Contact_DAO_SavedSearch();
@@ -69,11 +69,12 @@ class CRM_Contact_BAO_SavedSearch extends CRM_Contact_DAO_SavedSearch {
    * Takes a bunch of params that are needed to match certain criteria and
    * retrieves the relevant objects.
    *
-   * @param array $params   (reference ) an assoc array of name/value pairs
-   * @param array $defaults (reference ) an assoc array to hold the flattened values
+   * @param array $params
+   *   (reference ) an assoc array of name/value pairs.
+   * @param array $defaults
+   *   (reference ) an assoc array to hold the flattened values.
    *
    * @return CRM_Contact_BAO_SavedSearch
-   * @static
    */
   public static function retrieve(&$params, &$defaults) {
     $savedSearch = new CRM_Contact_DAO_SavedSearch();
@@ -88,10 +89,11 @@ class CRM_Contact_BAO_SavedSearch extends CRM_Contact_DAO_SavedSearch {
   /**
    * Given an id, extract the formValues of the saved search
    *
-   * @param int $id the id of the saved search
+   * @param int $id
+   *   The id of the saved search.
    *
-   * @return array the values of the posted saved search
-   * @static
+   * @return array
+   *   the values of the posted saved search
    */
   public static function &getFormValues($id) {
     $fv = CRM_Core_DAO::getFieldValue('CRM_Contact_DAO_SavedSearch', $id, 'form_values');
@@ -149,21 +151,25 @@ class CRM_Contact_BAO_SavedSearch extends CRM_Contact_DAO_SavedSearch {
   /**
    * Get the where clause for a saved search
    *
-   * @param int $id saved search id
-   * @param  array $tables (reference ) add the tables that are needed for the select clause
-   * @param  array $whereTables (reference ) add the tables that are needed for the where clause
+   * @param int $id
+   *   Saved search id.
+   * @param array $tables
+   *   (reference ) add the tables that are needed for the select clause.
+   * @param array $whereTables
+   *   (reference ) add the tables that are needed for the where clause.
    *
-   * @return string the where clause for this saved search
-   * @static
+   * @return string
+   *   the where clause for this saved search
    */
   public static function whereClause($id, &$tables, &$whereTables) {
     $params = self::getSearchParams($id);
     if ($params) {
       if (!empty($params['customSearchID'])) {
         // this has not yet been implemented
-      } else {
-      return CRM_Contact_BAO_Query::getWhereClause($params, NULL, $tables, $whereTables);
-    }
+      }
+      else {
+        return CRM_Contact_BAO_Query::getWhereClause($params, NULL, $tables, $whereTables);
+      }
     }
     return NULL;
   }
@@ -206,8 +212,8 @@ WHERE  $where";
       }
       else {
         $tables = $whereTables = array('civicrm_contact' => 1, 'civicrm_email' => 1);
-        $where  = CRM_Contact_BAO_SavedSearch::whereClause($id, $tables, $whereTables);
-        $from   = CRM_Contact_BAO_Query::fromClause($whereTables);
+        $where = CRM_Contact_BAO_SavedSearch::whereClause($id, $tables, $whereTables);
+        $from = CRM_Contact_BAO_Query::fromClause($whereTables);
         return array($from, $where);
       }
     }
@@ -248,8 +254,6 @@ LEFT JOIN civicrm_email ON (contact_a.id = civicrm_email.contact_id AND civicrm_
         $this->where_tables = serialize($whereTables);
       }
     }
-
-    return;
   }
 
   public function save() {
@@ -262,12 +266,13 @@ LEFT JOIN civicrm_email ON (contact_a.id = civicrm_email.contact_id AND civicrm_
   /**
    * Given an id, get the name of the saved search
    *
-   * @param int $id the id of the saved search
+   * @param int $id
+   *   The id of the saved search.
    *
    * @param string $value
    *
-   * @return string the name of the saved search
-   * @static
+   * @return string
+   *   the name of the saved search
    */
   public static function getName($id, $value = 'name') {
     $group = new CRM_Contact_DAO_Group();