* Create or delete.
* @param array $owner
* Primary membership info (membership_id, contact_id, membership_type ...).
+ *
+ * @throws \CRM_Core_Exception
+ * @throws \CiviCRM_API3_Exception
*/
public function relAction($action, $owner) {
switch ($action) {
'skipStatusCal' => TRUE,
'createActivity' => TRUE,
];
- // @todo stop passing $ids here (we are only doing so because of passbyreference)
- $ids = [];
- CRM_Member_BAO_Membership::create($params, $ids);
+ CRM_Member_BAO_Membership::create($params);
$relatedDisplayName = CRM_Contact_BAO_Contact::displayName($params['contact_id']);
CRM_Core_Session::setStatus(ts('Related membership for %1 has been created.', [1 => $relatedDisplayName]),
ts('Membership Added'), 'success');
break;
default:
- CRM_Core_Error::fatal(ts("Invalid action specified in URL"));
+ throw new CRM_Core_Exception(ts('Invalid action specified in URL'));
}
// Redirect back to membership view page for the owner, without the relAction parameters