Merge remote-tracking branch 'upstream/4.5' into 4.5-4.6-2015-04-13-16-08-08
[civicrm-core.git] / CRM / Contact / BAO / SearchCustom.php
index 13a9050d75935e9da049fdcad0a2f04a73a03920..8b1071b9fb9ab357e5d24856c2ef7fa45f7a137e 100644 (file)
@@ -1,9 +1,9 @@
 <?php
 /*
  +--------------------------------------------------------------------+
- | CiviCRM version 4.5                                                |
+ | CiviCRM version 4.6                                                |
  +--------------------------------------------------------------------+
- | Copyright CiviCRM LLC (c) 2004-2014                                |
+ | Copyright CiviCRM LLC (c) 2004-2015                                |
  +--------------------------------------------------------------------+
  | This file is a part of CiviCRM.                                    |
  |                                                                    |
  | GNU Affero General Public License or the licensing of CiviCRM,     |
  | see the CiviCRM license FAQ at http://civicrm.org/licensing        |
  +--------------------------------------------------------------------+
-*/
+ */
 
 /**
  *
  * @package CRM
- * @copyright CiviCRM LLC (c) 2004-2014
+ * @copyright CiviCRM LLC (c) 2004-2015
  * $Id$
  *
  */
@@ -42,7 +42,7 @@ class CRM_Contact_BAO_SearchCustom {
    * @return array
    * @throws Exception
    */
-  static function details($csID, $ssID = NULL, $gID = NULL) {
+  public static function details($csID, $ssID = NULL, $gID = NULL) {
     $error = array(NULL, NULL, NULL);
 
     if (!$csID &&
@@ -82,16 +82,16 @@ class CRM_Contact_BAO_SearchCustom {
 
     if (!$ext->isExtensionKey($customSearchClass)) {
       $customSearchFile = str_replace('_',
-        DIRECTORY_SEPARATOR,
-        $customSearchClass
-      ) . '.php';
+          DIRECTORY_SEPARATOR,
+          $customSearchClass
+        ) . '.php';
     }
     else {
       $customSearchFile = $ext->keyToPath($customSearchClass);
       $customSearchClass = $ext->keyToClass($customSearchClass);
     }
 
-    $error = include_once ($customSearchFile);
+    $error = include_once $customSearchFile;
     if ($error == FALSE) {
       CRM_Core_Error::fatal('Custom search file: ' . $customSearchFile . ' does not exist. Please verify your custom search settings in CiviCRM administrative panel.');
     }
@@ -106,7 +106,7 @@ class CRM_Contact_BAO_SearchCustom {
    * @return mixed
    * @throws Exception
    */
-  static function customClass($csID, $ssID) {
+  public static function customClass($csID, $ssID) {
     list($customSearchID, $customSearchClass, $formValues) = self::details($csID, $ssID);
 
     if (!$customSearchID) {
@@ -114,7 +114,7 @@ class CRM_Contact_BAO_SearchCustom {
     }
 
     // instantiate the new class
-    $customClass = new $customSearchClass( $formValues );
+    $customClass = new $customSearchClass($formValues);
 
     return $customClass;
   }
@@ -125,7 +125,7 @@ class CRM_Contact_BAO_SearchCustom {
    *
    * @return mixed
    */
-  static function contactIDSQL($csID, $ssID) {
+  public static function contactIDSQL($csID, $ssID) {
     $customClass = self::customClass($csID, $ssID);
     return $customClass->contactIDs();
   }
@@ -135,7 +135,7 @@ class CRM_Contact_BAO_SearchCustom {
    *
    * @return array
    */
-  static function &buildFormValues($args) {
+  public static function &buildFormValues($args) {
     $args = trim($args);
 
     $values = explode("\n", $args);
@@ -155,14 +155,13 @@ class CRM_Contact_BAO_SearchCustom {
    *
    * @return array
    */
-  static function fromWhereEmail($csID, $ssID) {
+  public static function fromWhereEmail($csID, $ssID) {
     $customClass = self::customClass($csID, $ssID);
 
     $from = $customClass->from();
     $where = $customClass->where();
 
-
     return array($from, $where);
   }
-}
 
+}