X-Git-Url: https://vcs.fsf.org/?a=blobdiff_plain;f=CRM%2FContact%2FBAO%2FSavedSearch.php;h=2581794f36f6809f00d9b141d23e8c540fc15325;hb=6594935cdf40a89db938cab053596b776e011bc7;hp=95c46916087580924c2feb655368b6b8e2f4c6a4;hpb=b1c21179dffc2cee95b1b39f0c6a5ce5b8574b8e;p=civicrm-core.git diff --git a/CRM/Contact/BAO/SavedSearch.php b/CRM/Contact/BAO/SavedSearch.php index 95c4691608..2581794f36 100644 --- a/CRM/Contact/BAO/SavedSearch.php +++ b/CRM/Contact/BAO/SavedSearch.php @@ -40,7 +40,7 @@ class CRM_Contact_BAO_SavedSearch extends CRM_Contact_DAO_SavedSearch { /** - * class constructor + * Class constructor * * @return \CRM_Contact_BAO_SavedSearch CRM_Contact_BAO_SavedSearch */ @@ -49,7 +49,7 @@ class CRM_Contact_BAO_SavedSearch extends CRM_Contact_DAO_SavedSearch { } /** - * 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 * @@ -73,7 +73,7 @@ class CRM_Contact_BAO_SavedSearch extends CRM_Contact_DAO_SavedSearch { * @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 + * @return CRM_Contact_BAO_SavedSearch * @access public * @static */ @@ -88,7 +88,7 @@ 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 * @@ -130,9 +130,14 @@ class CRM_Contact_BAO_SavedSearch extends CRM_Contact_DAO_SavedSearch { return $result; } + /** + * @param int $id + * + * @return array + */ static function getSearchParams($id) { $fv = self::getFormValues($id); - //check if the saved seach has mapping id + //check if the saved search has mapping id if (CRM_Core_DAO::getFieldValue('CRM_Contact_DAO_SavedSearch', $id, 'mapping_id')) { return CRM_Core_BAO_Mapping::formattedFields($fv); } @@ -145,7 +150,7 @@ 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 @@ -167,6 +172,11 @@ class CRM_Contact_BAO_SavedSearch extends CRM_Contact_DAO_SavedSearch { return NULL; } + /** + * @param int $id + * + * @return string + */ static function contactIDsSQL($id) { $params = self::getSearchParams($id); if ($params && !empty($params['customSearchID'])) { @@ -186,6 +196,11 @@ WHERE $where"; } } + /** + * @param int $id + * + * @return array + */ static function fromWhereEmail($id) { $params = self::getSearchParams($id); @@ -214,7 +229,7 @@ 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() { @@ -249,7 +264,7 @@ 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 *