本文整理汇总了PHP中CRM_Member_BAO_Membership::copyValues方法的典型用法代码示例。如果您正苦于以下问题:PHP CRM_Member_BAO_Membership::copyValues方法的具体用法?PHP CRM_Member_BAO_Membership::copyValues怎么用?PHP CRM_Member_BAO_Membership::copyValues使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类CRM_Member_BAO_Membership
的用法示例。
在下文中一共展示了CRM_Member_BAO_Membership::copyValues方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: 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 bool $active
* Do you want only active memberships to.
* be returned
* @param bool $relatedMemberships
*
* @return CRM_Member_BAO_Membership|null
* The found object or null
*/
public static function &getValues(&$params, &$values, $active = FALSE, $relatedMemberships = FALSE)
{
if (empty($params)) {
return NULL;
}
$membership = new CRM_Member_BAO_Membership();
$membership->copyValues($params);
$membership->find();
$memberships = array();
while ($membership->fetch()) {
if ($active && !CRM_Core_DAO::getFieldValue('CRM_Member_DAO_MembershipStatus', $membership->status_id, 'is_current_member')) {
continue;
}
CRM_Core_DAO::storeValues($membership, $values[$membership->id]);
$memberships[$membership->id] = $membership;
if ($relatedMemberships && !empty($membership->owner_membership_id)) {
$values['owner_membership_ids'][] = $membership->owner_membership_id;
}
}
return $memberships;
}
示例2: array
/**
* 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 boolean $active do you want only active memberships to
* be returned
*
* @return CRM_Member_BAO_Membership|null the found object or null
* @access public
* @static
*/
static function &getValues(&$params, &$values, $active = false)
{
if (empty($params)) {
return null;
}
$membership = new CRM_Member_BAO_Membership();
$membership->copyValues($params);
$membership->find();
$memberships = array();
while ($membership->fetch()) {
if ($active && !CRM_Core_DAO::getFieldValue('CRM_Member_DAO_MembershipStatus', $membership->status_id, 'is_current_member')) {
continue;
}
CRM_Core_DAO::storeValues($membership, $values[$membership->id]);
$memberships[$membership->id] = $membership;
}
return $memberships;
}