-
Notifications
You must be signed in to change notification settings - Fork 8
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
BTHAB-284: Add new entity to store membership rate
- Loading branch information
1 parent
ada66ba
commit 966f334
Showing
16 changed files
with
944 additions
and
45 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
<?php | ||
use CRM_MembershipExtras_ExtensionUtil as E; | ||
|
||
class CRM_MembershipExtras_BAO_MembershipRate extends CRM_MembershipExtras_DAO_MembershipRate { | ||
|
||
/** | ||
* Create a new MembershipRate based on array-data | ||
* | ||
* @param array $params key-value pairs | ||
* @return CRM_MembershipExtras_DAO_MembershipRate|NULL | ||
* | ||
*/ | ||
public static function create($params) { | ||
$className = 'CRM_MembershipExtras_DAO_MembershipRate'; | ||
$entityName = 'MembershipRate'; | ||
$hook = empty($params['id']) ? 'create' : 'edit'; | ||
|
||
CRM_Utils_Hook::pre($hook, $entityName, CRM_Utils_Array::value('id', $params), $params); | ||
$instance = new $className(); | ||
$instance->copyValues($params); | ||
$instance->save(); | ||
CRM_Utils_Hook::post($hook, $entityName, $instance->id, $instance); | ||
|
||
return $instance; | ||
} | ||
|
||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
<?php | ||
use CRM_MembershipExtras_ExtensionUtil as E; | ||
|
||
class CRM_MembershipExtras_BAO_MembershipRateMembershipType extends CRM_MembershipExtras_DAO_MembershipRateMembershipType { | ||
|
||
/** | ||
* Create a new MembershipRateMembershipType based on array-data | ||
* | ||
* @param array $params key-value pairs | ||
* @return CRM_MembershipExtras_DAO_MembershipRateMembershipType|NULL | ||
*/ | ||
public static function create($params) { | ||
$className = 'CRM_MembershipExtras_DAO_MembershipRateMembershipType'; | ||
$entityName = 'MembershipRateMembershipType'; | ||
$hook = empty($params['id']) ? 'create' : 'edit'; | ||
|
||
CRM_Utils_Hook::pre($hook, $entityName, CRM_Utils_Array::value('id', $params), $params); | ||
$instance = new $className(); | ||
$instance->copyValues($params); | ||
$instance->save(); | ||
CRM_Utils_Hook::post($hook, $entityName, $instance->id, $instance); | ||
|
||
return $instance; | ||
} | ||
|
||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.