MagicMerge - Per-request cache of path/url properties
[civicrm-core.git] / CRM / Core / BAO / UFJoin.php
index 8c5b05605537d34fb4a90a96b9143bc7aa5a6227..ba9dbf3fa269d9c92b165600a7014932f0cc4df0 100644 (file)
@@ -1,9 +1,9 @@
 <?php
 /*
  +--------------------------------------------------------------------+
- | CiviCRM version 4.6                                                |
+ | CiviCRM version 4.7                                                |
  +--------------------------------------------------------------------+
- | 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$
  *
  */
 class CRM_Core_BAO_UFJoin extends CRM_Core_DAO_UFJoin {
 
   /**
-   * Takes an associative array and creates a uf join object
+   * Takes an associative array and creates a uf join object.
    *
-   * @param array $params (reference) an assoc array of name/value pairs
+   * @param array $params
+   *   (reference) an assoc array of name/value pairs.
    *
-   * @return CRM_Core_DAO_UFJoin object
-   * @static
+   * @return CRM_Core_DAO_UFJoin
    */
   public static function &create($params) {
     // see if a record exists with the same weight
@@ -69,9 +69,9 @@ class CRM_Core_BAO_UFJoin extends CRM_Core_DAO_UFJoin {
    * @param array $params
    */
   public static function deleteAll(&$params) {
-    $module      = CRM_Utils_Array::value('module', $params);
+    $module = CRM_Utils_Array::value('module', $params);
     $entityTable = CRM_Utils_Array::value('entity_table', $params);
-    $entityID    = CRM_Utils_Array::value('entity_id', $params);
+    $entityID = CRM_Utils_Array::value('entity_id', $params);
 
     if (empty($entityTable) ||
       empty($entityID) ||
@@ -80,10 +80,10 @@ class CRM_Core_BAO_UFJoin extends CRM_Core_DAO_UFJoin {
       return;
     }
 
-    $dao               = new CRM_Core_DAO_UFJoin();
-    $dao->module       = $module;
+    $dao = new CRM_Core_DAO_UFJoin();
+    $dao->module = $module;
     $dao->entity_table = $entityTable;
-    $dao->entity_id    = $entityID;
+    $dao->entity_id = $entityID;
     $dao->delete();
   }
 
@@ -91,10 +91,11 @@ class CRM_Core_BAO_UFJoin extends CRM_Core_DAO_UFJoin {
    * Given an assoc list of params, find if there is a record
    * for this set of params
    *
-   * @param array $params (reference) an assoc array of name/value pairs
+   * @param array $params
+   *   (reference) an assoc array of name/value pairs.
    *
-   * @return int or null
-   * @static
+   * @return int
+   *   or null
    */
   public static function findJoinEntryId(&$params) {
     if (!empty($params['id'])) {
@@ -127,18 +128,19 @@ class CRM_Core_BAO_UFJoin extends CRM_Core_DAO_UFJoin {
    * Given an assoc list of params, find if there is a record
    * for this set of params and return the group id
    *
-   * @param array $params (reference) an assoc array of name/value pairs
+   * @param array $params
+   *   (reference) an assoc array of name/value pairs.
    *
-   * @return int or null
-   * @static
+   * @return int
+   *   or null
    */
   public static function findUFGroupId(&$params) {
 
     $dao = new CRM_Core_DAO_UFJoin();
 
     $dao->entity_table = CRM_Utils_Array::value('entity_table', $params);
-    $dao->entity_id    = CRM_Utils_Array::value('entity_id', $params);
-    $dao->weight       = CRM_Utils_Array::value('weight', $params);
+    $dao->entity_id = CRM_Utils_Array::value('entity_id', $params);
+    $dao->weight = CRM_Utils_Array::value('weight', $params);
     if ($dao->find(TRUE)) {
       return $dao->uf_group_id;
     }
@@ -177,4 +179,5 @@ class CRM_Core_BAO_UFJoin extends CRM_Core_DAO_UFJoin {
     }
     return array($first, $second, $firstActive, $secondActive);
   }
+
 }