예제 #1
0
 /**
  * Contact IDS Sql (whatever that means!).
  *
  * @param int $id
  *
  * @return string
  */
 public static function contactIDsSQL($id)
 {
     $params = self::getSearchParams($id);
     if ($params && !empty($params['customSearchID'])) {
         return CRM_Contact_BAO_SearchCustom::contactIDSQL(NULL, $id);
     } else {
         $tables = $whereTables = array('civicrm_contact' => 1);
         $where = CRM_Contact_BAO_SavedSearch::whereClause($id, $tables, $whereTables);
         if (!$where) {
             $where = '( 1 )';
         }
         $from = CRM_Contact_BAO_Query::fromClause($whereTables);
         return "\nSELECT contact_a.id\n{$from}\nWHERE  {$where}";
     }
 }
예제 #2
0
 static function contactIDsSQL($id)
 {
     $params =& self::getSearchParams($id);
     if ($params) {
         if (CRM_Utils_Array::value('customSearchID', $params)) {
             require_once 'CRM/Contact/BAO/SearchCustom.php';
             return CRM_Contact_BAO_SearchCustom::contactIDSQL(null, $id);
         } else {
             $tables = $whereTables = array($contact => 1);
             $where = CRM_Contact_BAO_SavedSearch::whereClause($id, $tables, $whereTables);
             if (!$where) {
                 $where = '( 1 )';
             }
             $from = CRM_Contact_BAO_Query::fromClause($whereTables);
             return "\nSELECT contact_a.id\n{$from}\nWHERE  {$where}";
         }
     } else {
         CRM_Core_Error::fatal('No contactID clause');
     }
 }