3 +--------------------------------------------------------------------+
4 | Copyright CiviCRM LLC. All rights reserved. |
6 | This work is published under the GNU AGPLv3 license with some |
7 | permitted exceptions and without any warranty. For full license |
8 | and copyright information, see https://civicrm.org/licensing |
9 +--------------------------------------------------------------------+
15 * @copyright CiviCRM LLC https://civicrm.org/licensing
19 class CRM_Member_BAO_MembershipBlock
extends CRM_Member_DAO_MembershipBlock
{
24 public function __construct() {
25 parent
::__construct();
29 * Add the membership Blocks.
31 * @param array $params
32 * Reference array contains the values submitted by the form.
37 public static function create(&$params) {
38 $hook = empty($params['id']) ?
'create' : 'edit';
39 CRM_Utils_Hook
::pre($hook, 'MembershipBlock', CRM_Utils_Array
::value('id', $params), $params);
40 $dao = new CRM_Member_DAO_MembershipBlock();
41 $dao->copyValues($params, TRUE);
42 $dao->id
= CRM_Utils_Array
::value('id', $params);
44 CRM_Utils_Hook
::post($hook, 'MembershipBlock', $dao->id
, $dao);
49 * Delete membership Blocks.
55 public static function del($id) {
56 $dao = new CRM_Member_DAO_MembershipBlock();
59 if ($dao->find(TRUE)) {