/**
* Class constructor
*/
- function __construct() {
+ public function __construct() {
parent::__construct();
}
+
/**
* Add the membership Payments
*
- * @param array $params reference array contains the values submitted by the form
+ * @param array $params
+ * Reference array contains the values submitted by the form.
*
- * @access public
- * @static
*
* @return object
*/
- static function create($params) {
+ public static function create($params) {
$hook = empty($params['id']) ? 'create' : 'edit';
CRM_Utils_Hook::pre($hook, 'MembershipPayment', CRM_Utils_Array::value('id', $params), $params);
$dao = new CRM_Member_DAO_MembershipPayment();
// table. However, at this stage we have both - there is still quite a bit of refactoring to do to set the line_iten entity_id right the first time
// however, we can assume at this stage that any contribution id will have only one line item with that membership type in the line item table
// OR the caller will have taken responsibility for updating the line items themselves so we will update using SQL here
- $membershipTypeID = civicrm_api3('membership', 'getvalue', array('id' => $dao->membership_id, 'return' => 'membership_type_id'));
+ $membershipTypeID = civicrm_api3('membership', 'getvalue', array(
+ 'id' => $dao->membership_id,
+ 'return' => 'membership_type_id',
+ ));
$sql = "UPDATE civicrm_line_item li
LEFT JOIN civicrm_price_field_value pv ON pv.id = li.price_field_value_id
SET entity_table = 'civicrm_membership', entity_id = %1
WHERE pv.membership_type_id = %2
AND contribution_id = %3";
- CRM_Core_DAO::executeQuery($sql, array(1 => array($dao->membership_id, 'Integer'), 2 => array($membershipTypeID, 'Integer'), 3 => array($dao->contribution_id, 'Integer')));
+ CRM_Core_DAO::executeQuery($sql, array(
+ 1 => array($dao->membership_id, 'Integer'),
+ 2 => array($membershipTypeID, 'Integer'),
+ 3 => array($dao->contribution_id, 'Integer'),
+ ));
return $dao;
}
* @param int $id
*
* @return bool
- * @static
*/
- static function del($id) {
+ public static function del($id) {
$dao = new CRM_Member_DAO_MembershipPayment();
$dao->id = $id;
$result = FALSE;
}
-