本文整理汇总了PHP中CRM_Contact_BAO_GroupContact::getValues方法的典型用法代码示例。如果您正苦于以下问题:PHP CRM_Contact_BAO_GroupContact::getValues方法的具体用法?PHP CRM_Contact_BAO_GroupContact::getValues怎么用?PHP CRM_Contact_BAO_GroupContact::getValues使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类CRM_Contact_BAO_GroupContact
的用法示例。
在下文中一共展示了CRM_Contact_BAO_GroupContact::getValues方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: unset
/**
* Takes a bunch of params that are needed to match certain criteria and
* retrieves the relevant objects. Typically the valid params are only
* contact_id. We'll tweak this function to be more full featured over a period
* of time. This is the inverse function of create. It also stores all the retrieved
* values in the default array
*
* @param array $params (reference ) an assoc array of name/value pairs
* @param array $defaults (reference ) an assoc array to hold the name / value pairs
* in a hierarchical manner
* @param array $ids (reference) the array that holds all the db ids
* @param boolean $microformat for location in microformat
*
* @return object CRM_Contact_BAO_Contact object
* @access public
* @static
*/
static function &retrieve(&$params, &$defaults, $microformat = false)
{
if (array_key_exists('contact_id', $params)) {
$params['id'] = $params['contact_id'];
} else {
if (array_key_exists('id', $params)) {
$params['contact_id'] = $params['id'];
}
}
$contact = self::_getValues($params, $defaults);
unset($params['id']);
//get the block information for this contact
$entityBlock = array('contact_id' => $params['contact_id']);
$blocks = CRM_Core_BAO_Location::getValues($entityBlock, $microformat);
$defaults = array_merge($defaults, $blocks);
foreach ($blocks as $block => $value) {
$contact->{$block} = $value;
}
$contact->notes =& CRM_Core_BAO_Note::getValues($params, $defaults);
$contact->relationship =& CRM_Contact_BAO_Relationship::getValues($params, $defaults);
$contact->groupContact =& CRM_Contact_BAO_GroupContact::getValues($params, $defaults);
return $contact;
}
示例2: elseif
/**
* Fetch object based on array of properties.
*
* @param array $params
* (reference ) an assoc array of name/value pairs.
* @param array $defaults
* (reference ) an assoc array to hold the name / value pairs.
* in a hierarchical manner
* @param bool $microformat
* For location in microformat.
*
* @return CRM_Contact_BAO_Contact
*/
public static function &retrieve(&$params, &$defaults, $microformat = FALSE)
{
if (array_key_exists('contact_id', $params)) {
$params['id'] = $params['contact_id'];
} elseif (array_key_exists('id', $params)) {
$params['contact_id'] = $params['id'];
}
$contact = self::getValues($params, $defaults);
unset($params['id']);
//get the block information for this contact
$entityBlock = array('contact_id' => $params['contact_id']);
$blocks = CRM_Core_BAO_Location::getValues($entityBlock, $microformat);
$defaults = array_merge($defaults, $blocks);
foreach ($blocks as $block => $value) {
$contact->{$block} = $value;
}
if (!isset($params['noNotes'])) {
$contact->notes = CRM_Core_BAO_Note::getValues($params, $defaults);
}
if (!isset($params['noRelationships'])) {
$contact->relationship = CRM_Contact_BAO_Relationship::getValues($params, $defaults);
}
if (!isset($params['noGroups'])) {
$contact->groupContact = CRM_Contact_BAO_GroupContact::getValues($params, $defaults);
}
if (!isset($params['noWebsite'])) {
$contact->website = CRM_Core_BAO_Website::getValues($params, $defaults);
}
return $contact;
}
示例3: retrieve
/**
* Takes a bunch of params that are needed to match certain criteria and
* retrieves the relevant objects. Typically the valid params are only
* contact_id. We'll tweak this function to be more full featured over a period
* of time. This is the inverse function of create. It also stores all the retrieved
* values in the default array
*
* @param array $params (reference ) an assoc array of name/value pairs
* @param array $defaults (reference ) an assoc array to hold the name / value pairs
* in a hierarchical manner
* @param array $ids (reference) the array that holds all the db ids
*
* @return object CRM_Contact_BAO_Contact object
* @access public
* @static
*/
function retrieve(&$params, &$defaults, &$ids)
{
$contact = CRM_Contact_BAO_Contact::getValues($params, $defaults, $ids);
unset($params['id']);
require_once str_replace('_', DIRECTORY_SEPARATOR, "CRM_Contact_BAO_" . $contact->contact_type) . ".php";
eval('$contact->contact_type_object =& CRM_Contact_BAO_' . $contact->contact_type . '::getValues( $params, $defaults, $ids );');
$locParams = $params + array('entity_id' => $params['contact_id'], 'entity_table' => CRM_Contact_BAO_Contact::getTableName());
$contact->location =& CRM_Core_BAO_Location::getValues($locParams, $defaults, $ids, 3);
$contact->notes =& CRM_Core_BAO_Note::getValues($params, $defaults, $ids);
$contact->relationship =& CRM_Contact_BAO_Relationship::getValues($params, $defaults, $ids);
$contact->groupContact =& CRM_Contact_BAO_GroupContact::getValues($params, $defaults, $ids);
$activityParam = array('entity_id' => $params['contact_id']);
$contact->activity =& CRM_Core_BAO_History::getValues($activityParam, $defaults, 'Activity');
$activityParam = array('contact_id' => $params['contact_id']);
$defaults['openActivity'] = array('data' => CRM_Contact_BAO_Contact::getOpenActivities($activityParam, 0, 3), 'totalCount' => CRM_Contact_BAO_Contact::getNumOpenActivity($params['contact_id']));
return $contact;
}