INFRA-132 - CRM/Contact - Convert single-line @param to multi-line
[civicrm-core.git] / CRM / Contact / BAO / SavedSearch.php
index b13a2f35fde3e0c46039c5e5a3d71470b39922eb..782b1f7c0592627ab19bddbb321b240fc1f58a3c 100644 (file)
@@ -1,7 +1,7 @@
 <?php
 /*
  +--------------------------------------------------------------------+
- | CiviCRM version 4.5                                                |
+ | CiviCRM version 4.6                                                |
  +--------------------------------------------------------------------+
  | Copyright CiviCRM LLC (c) 2004-2014                                |
  +--------------------------------------------------------------------+
 class CRM_Contact_BAO_SavedSearch extends CRM_Contact_DAO_SavedSearch {
 
   /**
-   * class constructor
+   * Class constructor
    *
    * @return \CRM_Contact_BAO_SavedSearch CRM_Contact_BAO_SavedSearch
    */
-  function __construct() {
+  public function __construct() {
     parent::__construct();
   }
 
   /**
-   * query the db for all saved searches.
+   * Query the db for all saved searches.
    *
    * @return array $aSavedSearch - contains the search name as value and and id as key
    *
-   * @access public
    */
-  function getAll() {
+  public function getAll() {
     $savedSearch = new CRM_Contact_DAO_SavedSearch();
     $savedSearch->selectAdd();
     $savedSearch->selectAdd('id, name');
@@ -70,14 +69,15 @@ 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 object CRM_Contact_BAO_SavedSearch
-   * @access public
+   * @return CRM_Contact_BAO_SavedSearch
    * @static
    */
-  static function retrieve(&$params, &$defaults) {
+  public static function retrieve(&$params, &$defaults) {
     $savedSearch = new CRM_Contact_DAO_SavedSearch();
     $savedSearch->copyValues($params);
     if ($savedSearch->find(TRUE)) {
@@ -88,15 +88,15 @@ class CRM_Contact_BAO_SavedSearch extends CRM_Contact_DAO_SavedSearch {
   }
 
   /**
-   * given an id, extract the formValues of the saved search
+   * 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
-   * @access public
    * @static
    */
-  static function &getFormValues($id) {
+  public static function &getFormValues($id) {
     $fv = CRM_Core_DAO::getFieldValue('CRM_Contact_DAO_SavedSearch', $id, 'form_values');
     $result = NULL;
     if ($fv) {
@@ -131,11 +131,11 @@ class CRM_Contact_BAO_SavedSearch extends CRM_Contact_DAO_SavedSearch {
   }
 
   /**
-   * @param $id
+   * @param int $id
    *
    * @return array
    */
-  static function getSearchParams($id) {
+  public static function getSearchParams($id) {
     $fv = self::getFormValues($id);
     //check if the saved search has mapping id
     if (CRM_Core_DAO::getFieldValue('CRM_Contact_DAO_SavedSearch', $id, 'mapping_id')) {
@@ -150,17 +150,19 @@ class CRM_Contact_BAO_SavedSearch extends CRM_Contact_DAO_SavedSearch {
   }
 
   /**
-   * get the where clause for a saved search
+   * 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
-   * @access public
    * @static
    */
-  static function whereClause($id, &$tables, &$whereTables) {
+  public static function whereClause($id, &$tables, &$whereTables) {
     $params = self::getSearchParams($id);
     if ($params) {
       if (!empty($params['customSearchID'])) {
@@ -173,11 +175,11 @@ class CRM_Contact_BAO_SavedSearch extends CRM_Contact_DAO_SavedSearch {
   }
 
   /**
-   * @param $id
+   * @param int $id
    *
    * @return string
    */
-  static function contactIDsSQL($id) {
+  public static function contactIDsSQL($id) {
     $params = self::getSearchParams($id);
     if ($params && !empty($params['customSearchID'])) {
       return CRM_Contact_BAO_SearchCustom::contactIDSQL(NULL, $id);
@@ -197,11 +199,11 @@ WHERE  $where";
   }
 
   /**
-   * @param $id
+   * @param int $id
    *
    * @return array
    */
-  static function fromWhereEmail($id) {
+  public static function fromWhereEmail($id) {
     $params = self::getSearchParams($id);
 
     if ($params) {
@@ -229,10 +231,10 @@ LEFT JOIN civicrm_email ON (contact_a.id = civicrm_email.contact_id AND civicrm_
   }
 
   /**
-   * given a saved search compute the clause and the tables
+   * Given a saved search compute the clause and the tables
    * and store it for future use
    */
-  function buildClause() {
+  public function buildClause() {
     $fv = unserialize($this->form_values);
 
     if ($this->mapping_id) {
@@ -256,7 +258,7 @@ LEFT JOIN civicrm_email ON (contact_a.id = civicrm_email.contact_id AND civicrm_
     return;
   }
 
-  function save() {
+  public function save() {
     // first build the computed fields
     $this->buildClause();
 
@@ -264,17 +266,17 @@ LEFT JOIN civicrm_email ON (contact_a.id = civicrm_email.contact_id AND civicrm_
   }
 
   /**
-   * given an id, get the name of the saved search
+   * 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
-   * @access public
    * @static
    */
-  static function getName($id, $value = 'name') {
+  public static function getName($id, $value = 'name') {
     $group = new CRM_Contact_DAO_Group();
     $group->saved_search_id = $id;
     if ($group->find(TRUE)) {
@@ -287,7 +289,7 @@ LEFT JOIN civicrm_email ON (contact_a.id = civicrm_email.contact_id AND civicrm_
    * Given a label and a set of normalized POST
    * formValues, create a smart group with that
    */
-  static function create(&$params) {
+  public static function create(&$params) {
     $savedSearch = new CRM_Contact_DAO_SavedSearch();
     if (isset($params['formValues']) &&
       !empty($params['formValues'])
@@ -308,4 +310,3 @@ LEFT JOIN civicrm_email ON (contact_a.id = civicrm_email.contact_id AND civicrm_
     return $savedSearch;
   }
 }
-