Ejemplo n.º 1
0
 /**
  * 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
  * pairs
  *
  * @param array  $params         (reference ) an assoc array of name/value pairs
  *
  * @return object CRM_Contact_BAO_Group object
  * @access public
  * @static
  */
 function add(&$params)
 {
     $dataExists = CRM_Contact_BAO_GroupContact::dataExists($params);
     if (!$dataExists) {
         return null;
     }
     $groupContact =& new CRM_Contact_BAO_GroupContact();
     $groupContact->copyValues($params);
     CRM_Contact_BAO_SubscriptionHistory::create($params);
     $groupContact->save();
     return $groupContact;
 }