Skip to content

Commit

Permalink
Deprecations in Event, Membership
Browse files Browse the repository at this point in the history
  • Loading branch information
eileenmcnaughton committed Mar 1, 2023
1 parent 81e3d6f commit 44faf34
Show file tree
Hide file tree
Showing 9 changed files with 10 additions and 4 deletions.
1 change: 1 addition & 0 deletions CRM/Event/BAO/Event.php
Original file line number Diff line number Diff line change
Expand Up @@ -172,6 +172,7 @@ public static function create(&$params) {
* @deprecated
*/
public static function del($id) {
CRM_Core_Error::deprecatedFunctionWarning('deleteRecord');
return (bool) static::deleteRecord(['id' => $id]);
}

Expand Down
2 changes: 1 addition & 1 deletion CRM/Event/Form/ManageEvent/Delete.php
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,7 @@ public function postProcess() {
), ts('Deletion Error'), 'error');
return;
}
CRM_Event_BAO_Event::del($this->_id);
CRM_Event_BAO_Event::deleteRecord(['id' => $this->_id]);
if ($this->_isTemplate) {
CRM_Core_Session::setStatus(ts("'%1' has been deleted.", [1 => $this->_title]), ts('Template Deleted'), 'success');
CRM_Utils_System::redirect(CRM_Utils_System::url('civicrm/admin/eventTemplate', 'reset=1'));
Expand Down
2 changes: 2 additions & 0 deletions CRM/Member/BAO/MembershipBlock.php
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ class CRM_Member_BAO_MembershipBlock extends CRM_Member_DAO_MembershipBlock {
* @return CRM_Member_DAO_MembershipBlock
*/
public static function create($params) {
CRM_Core_Error::deprecatedFunctionWarning('writeRecord');
return self::writeRecord($params);
}

Expand All @@ -35,6 +36,7 @@ public static function create($params) {
* @return bool
*/
public static function del($id) {
CRM_Core_Error::deprecatedFunctionWarning('deleteRecord');
return (bool) self::deleteRecord(['id' => $id]);
}

Expand Down
1 change: 1 addition & 0 deletions CRM/Member/BAO/MembershipPayment.php
Original file line number Diff line number Diff line change
Expand Up @@ -81,6 +81,7 @@ public static function create($params) {
* @return bool
*/
public static function del($id) {
CRM_Core_Error::deprecatedFunctionWarning('deleteRecord');
return (bool) self::deleteRecord(['id' => $id]);
}

Expand Down
1 change: 1 addition & 0 deletions CRM/Member/BAO/MembershipStatus.php
Original file line number Diff line number Diff line change
Expand Up @@ -151,6 +151,7 @@ public static function getMembershipStatus($membershipStatusId) {
* @throws CRM_Core_Exception
*/
public static function del($membershipStatusId) {
CRM_Core_Error::deprecatedFunctionWarning('deleteRecord');
static::deleteRecord(['id' => $membershipStatusId]);
}

Expand Down
1 change: 1 addition & 0 deletions CRM/Member/BAO/MembershipType.php
Original file line number Diff line number Diff line change
Expand Up @@ -123,6 +123,7 @@ public static function flush() {
* @return bool
*/
public static function del($membershipTypeId) {
CRM_Core_Error::deprecatedFunctionWarning('deleteRecord');
try {
static::deleteRecord(['id' => $membershipTypeId]);
return TRUE;
Expand Down
2 changes: 1 addition & 1 deletion CRM/Member/Form/MembershipBlock.php
Original file line number Diff line number Diff line change
Expand Up @@ -151,7 +151,7 @@ public function buildQuickForm() {
//CRM-15573
if (!empty($params['id'])) {
$params['membership_types'] = serialize($membershipRequired);
CRM_Member_BAO_MembershipBlock::create($params);
CRM_Member_BAO_MembershipBlock::writeRecord($params);
}
$this->add('hidden', "mem_price_field_id", '', ['id' => "mem_price_field_id"]);
$this->assign('is_recur', $isRecur);
Expand Down
2 changes: 1 addition & 1 deletion CRM/Member/Form/MembershipStatus.php
Original file line number Diff line number Diff line change
Expand Up @@ -150,7 +150,7 @@ public function buildQuickForm() {
public function postProcess() {
if ($this->_action & CRM_Core_Action::DELETE) {
try {
CRM_Member_BAO_MembershipStatus::del($this->_id);
CRM_Member_BAO_MembershipStatus::deleteRecord(['id' => $this->_id]);
}
catch (CRM_Core_Exception $e) {
CRM_Core_Error::statusBounce($e->getMessage(), NULL, ts('Delete Failed'));
Expand Down
2 changes: 1 addition & 1 deletion CRM/Member/Form/MembershipType.php
Original file line number Diff line number Diff line change
Expand Up @@ -383,7 +383,7 @@ public static function formRule($params) {
public function postProcess() {
if ($this->_action & CRM_Core_Action::DELETE) {
try {
CRM_Member_BAO_MembershipType::del($this->_id);
CRM_Member_BAO_MembershipType::deleteRecord(['id' => $this->_id]);
}
catch (CRM_Core_Exception $e) {
CRM_Core_Error::statusBounce($e->getMessage(), NULL, ts('Membership Type Not Deleted'));
Expand Down

0 comments on commit 44faf34

Please sign in to comment.