Commit | Line | Data |
---|---|---|
b488bd43 TO |
1 | <?php |
2 | /* | |
3 | +--------------------------------------------------------------------+ | |
bc77d7c0 | 4 | | Copyright CiviCRM LLC. All rights reserved. | |
b488bd43 | 5 | | | |
bc77d7c0 TO |
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 | | |
b488bd43 | 9 | +--------------------------------------------------------------------+ |
d25dd0ee | 10 | */ |
b488bd43 TO |
11 | |
12 | /** | |
13 | * | |
14 | * @package CRM | |
ca5cec67 | 15 | * @copyright CiviCRM LLC https://civicrm.org/licensing |
b488bd43 TO |
16 | * $Id$ |
17 | * | |
18 | */ | |
19 | class CRM_Member_BAO_MembershipBlock extends CRM_Member_DAO_MembershipBlock { | |
971e129b | 20 | |
28abbcb0 | 21 | /** |
fe482240 | 22 | * Class constructor. |
28abbcb0 | 23 | */ |
00be9182 | 24 | public function __construct() { |
28abbcb0 | 25 | parent::__construct(); |
26 | } | |
353ffa53 | 27 | |
28abbcb0 | 28 | /** |
6a5fec96 | 29 | * Create or update a MembershipBlock. |
28abbcb0 | 30 | * |
b2363ea8 | 31 | * @param array $params |
6a5fec96 | 32 | * @return CRM_Member_DAO_MembershipBlock |
28abbcb0 | 33 | */ |
6a5fec96 CW |
34 | public static function create($params) { |
35 | return self::writeRecord($params); | |
28abbcb0 | 36 | } |
37 | ||
38 | /** | |
fe482240 | 39 | * Delete membership Blocks. |
28abbcb0 | 40 | * |
41 | * @param int $id | |
77b97be7 EM |
42 | * |
43 | * @return bool | |
28abbcb0 | 44 | */ |
00be9182 | 45 | public static function del($id) { |
784a6e4a | 46 | $dao = new CRM_Member_DAO_MembershipBlock(); |
28abbcb0 | 47 | $dao->id = $id; |
48 | $result = FALSE; | |
49 | if ($dao->find(TRUE)) { | |
50 | $dao->delete(); | |
51 | $result = TRUE; | |
52 | } | |
53 | return $result; | |
54 | } | |
55 | ||
56 | } |