Merge pull request #4724 from atif-shaikh/CRM-15598
[civicrm-core.git] / CRM / Contact / BAO / GroupContact.php
index 23bceb8009ea0c1b001185446fbc1c3d9a10d84e..0c1425ca060e353c580e69c09007cafd67373216 100644 (file)
 class CRM_Contact_BAO_GroupContact extends CRM_Contact_DAO_GroupContact {
 
   /**
-   * class constructor
+   * Class constructor
    */
   function __construct() {
     parent::__construct();
   }
 
   /**
-   * takes an associative array and creates a groupContact object
+   * Takes an associative array and creates a groupContact object
    *
    * the function extract all the params it needs to initialize the create a
    * group object. the params array could contain additional unused name/value
@@ -50,7 +50,7 @@ class CRM_Contact_BAO_GroupContact extends CRM_Contact_DAO_GroupContact {
    *
    * @param array  $params         (reference ) an assoc array of name/value pairs
    *
-   * @return object CRM_Contact_BAO_Group object
+   * @return CRM_Contact_BAO_Group object
    * @access public
    * @static
    */
@@ -90,9 +90,8 @@ class CRM_Contact_BAO_GroupContact extends CRM_Contact_DAO_GroupContact {
    * Given the list of params in the params array, fetch the object
    * and store the values in the values array
    *
-   * @param array $params        input parameters to find object
-   * @param array $values        output values of the object
-   * @param array $ids           the array that holds all the db ids
+   * @param array $params input parameters to find object
+   * @param array $values output values of the object
    *
    * @return array (reference)   the values that could be potentially assigned to smarty
    * @access public
@@ -168,8 +167,12 @@ class CRM_Contact_BAO_GroupContact extends CRM_Contact_DAO_GroupContact {
   /**
    * Given an array of contact ids, remove all the contacts from the group
    *
-   * @param array  $contactIds (reference ) the array of contact ids to be removed
-   * @param int    $groupId    the id of the group
+   * @param array $contactIds (reference ) the array of contact ids to be removed
+   * @param int $groupId the id of the group
+   *
+   * @param string $method
+   * @param string $status
+   * @param null $tracking
    *
    * @return array             (total, removed, notRemoved) count of contacts removed to group
    * @access public
@@ -263,10 +266,12 @@ class CRM_Contact_BAO_GroupContact extends CRM_Contact_DAO_GroupContact {
   }
 
   /**
-   * Function to get list of all the groups and groups for a contact
+   * Get list of all the groups and groups for a contact
    *
    * @param  int $contactId contact id
    *
+   * @param bool $visibility
+   *
    * @access public
    *
    * @return array $values this array has key-> group id and value group title
@@ -304,16 +309,18 @@ class CRM_Contact_BAO_GroupContact extends CRM_Contact_DAO_GroupContact {
   }
 
   /**
-   * Function to get the list of groups for contact based on status of group membership
+   * Get the list of groups for contact based on status of group membership
    *
-   * @param int     $contactId         contact id
-   * @param string  $status            state of membership
-   * @param int     $numGroupContact   number of groups for a contact that should be shown
-   * @param boolean $count             true if we are interested only in the count
-   * @param boolean $ignorePermission  true if we should ignore permissions for the current user
+   * @param int $contactId contact id
+   * @param string $status state of membership
+   * @param int $numGroupContact number of groups for a contact that should be shown
+   * @param boolean $count true if we are interested only in the count
+   * @param boolean $ignorePermission true if we should ignore permissions for the current user
    *                                   useful in profile where permissions are limited for the user. If left
    *                                   at false only groups viewable by the current user are returned
-   * @param boolean $onlyPublicGroups  true if we want to hide system groups
+   * @param boolean $onlyPublicGroups true if we want to hide system groups
+   *
+   * @param bool $excludeHidden
    *
    * @return array (reference )|int $values the relevant data object values for the contact or
    *                                 the total count when $count is true
@@ -487,12 +494,15 @@ SELECT    *
   }
 
   /**
-   * takes an associative array and creates / removes
+   * Takes an associative array and creates / removes
    * contacts from the groups
    *
    *
    * @param array $params (reference ) an assoc array of name/value pairs
-   * @param array $contactId    contact id
+   * @param array $contactId contact id
+   *
+   * @param bool $visibility
+   * @param string $method
    *
    * @return void
    * @access public
@@ -546,6 +556,12 @@ SELECT    *
     }
   }
 
+  /**
+   * @param int $contactID
+   * @param int $groupID
+   *
+   * @return bool
+   */
   static function isContactInGroup($contactID, $groupID) {
     if (!CRM_Utils_Rule::positiveInteger($contactID) ||
       !CRM_Utils_Rule::positiveInteger($groupID)
@@ -676,8 +692,11 @@ AND       group_id IN ( $groupIDString )
   /**
    * Given an array of contact ids, add all the contacts to the group
    *
-   * @param array  $contactIds (reference ) the array of contact ids to be added
-   * @param int    $groupId    the id of the group
+   * @param array $contactIDs the array of contact ids to be added
+   * @param int $groupID the id of the group
+   * @param string $method
+   * @param string $status
+   * @param null $tracking
    *
    * @return array             (total, added, notAdded) count of contacts added to group
    * @access public