Merge pull request #6458 from totten/4.6-toxic-list
[civicrm-core.git] / CRM / Contact / BAO / Query / Hook.php
index 22195327de79ee2544435e2ea470fb07260896d6..486dfd5a05d2afa5783c22ab744212a4231ba38c 100644 (file)
@@ -1,9 +1,9 @@
 <?php
 /*
  +--------------------------------------------------------------------+
- | CiviCRM version 4.4                                                |
+ | CiviCRM version 4.6                                                |
  +--------------------------------------------------------------------+
- | Copyright CiviCRM LLC (c) 2004-2013                                |
+ | 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-2013
+ * @copyright CiviCRM LLC (c) 2004-2015
  * $Id$
  *
  */
@@ -44,11 +44,9 @@ class CRM_Contact_BAO_Query_Hook {
   protected $_queryObjects = NULL;
 
   /**
-   * singleton function used to manage this object
+   * Singleton function used to manage this object.
    *
    * @return object
-   * @static
-   *
    */
   public static function singleton() {
     static $singleton = NULL;
@@ -58,11 +56,12 @@ class CRM_Contact_BAO_Query_Hook {
     return $singleton;
   }
 
- /**
-  * Get or build the list of search objects (via hook)
-  *
-  * @return array of CRM_Contact_BAO_Query_Interface objects
-  */
+  /**
+   * Get or build the list of search objects (via hook)
+   *
+   * @return array
+   *   Array of CRM_Contact_BAO_Query_Interface objects
+   */
   public function getSearchQueryObjects() {
     if ($this->_queryObjects === NULL) {
       $this->_queryObjects = array();
@@ -71,6 +70,9 @@ class CRM_Contact_BAO_Query_Hook {
     return $this->_queryObjects;
   }
 
+  /**
+   * @return array
+   */
   public function &getFields() {
     $extFields = array();
     foreach (self::getSearchQueryObjects() as $obj) {
@@ -80,18 +82,33 @@ class CRM_Contact_BAO_Query_Hook {
     return $extFields;
   }
 
+  /**
+   * @param $apiEntities
+   * @param $fieldOptions
+   */
   public function alterSearchBuilderOptions(&$apiEntities, &$fieldOptions) {
     foreach (self::getSearchQueryObjects() as $obj) {
       $obj->alterSearchBuilderOptions($apiEntities, $fieldOptions);
     }
   }
 
+  /**
+   * @param $query
+   * @param string $fnName
+   */
   public function alterSearchQuery(&$query, $fnName) {
     foreach (self::getSearchQueryObjects() as $obj) {
       $obj->$fnName($query);
     }
   }
 
+  /**
+   * @param string $fieldName
+   * @param $mode
+   * @param $side
+   *
+   * @return string
+   */
   public function buildSearchfrom($fieldName, $mode, $side) {
     $from = '';
     foreach (self::getSearchQueryObjects() as $obj) {
@@ -100,33 +117,51 @@ class CRM_Contact_BAO_Query_Hook {
     return $from;
   }
 
+  /**
+   * @param $tables
+   */
   public function setTableDependency(&$tables) {
     foreach (self::getSearchQueryObjects() as $obj) {
       $obj->setTableDependency($tables);
     }
   }
 
+  /**
+   * @param $panes
+   */
   public function registerAdvancedSearchPane(&$panes) {
     foreach (self::getSearchQueryObjects() as $obj) {
       $obj->registerAdvancedSearchPane($panes);
     }
   }
 
+  /**
+   * @param $panes
+   */
   public function getPanesMapper(&$panes) {
     foreach (self::getSearchQueryObjects() as $obj) {
       $obj->getPanesMapper($panes);
     }
   }
 
+  /**
+   * @param CRM_Core_Form $form
+   * @param $type
+   */
   public function buildAdvancedSearchPaneForm(&$form, $type) {
     foreach (self::getSearchQueryObjects() as $obj) {
       $obj->buildAdvancedSearchPaneForm($form, $type);
     }
   }
 
+  /**
+   * @param $paneTemplatePathArray
+   * @param $type
+   */
   public function setAdvancedSearchPaneTemplatePath(&$paneTemplatePathArray, $type) {
     foreach (self::getSearchQueryObjects() as $obj) {
       $obj->setAdvancedSearchPaneTemplatePath($paneTemplatePathArray, $type);
     }
   }
+
 }