Merge pull request #18059 from civicrm/5.28
[civicrm-core.git] / CRM / Member / BAO / MembershipBlock.php
1 <?php
2 /*
3 +--------------------------------------------------------------------+
4 | Copyright CiviCRM LLC. All rights reserved. |
5 | |
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 +--------------------------------------------------------------------+
10 */
11
12 /**
13 *
14 * @package CRM
15 * @copyright CiviCRM LLC https://civicrm.org/licensing
16 */
17 class CRM_Member_BAO_MembershipBlock extends CRM_Member_DAO_MembershipBlock {
18
19 /**
20 * Class constructor.
21 */
22 public function __construct() {
23 parent::__construct();
24 }
25
26 /**
27 * Create or update a MembershipBlock.
28 *
29 * @param array $params
30 * @return CRM_Member_DAO_MembershipBlock
31 */
32 public static function create($params) {
33 return self::writeRecord($params);
34 }
35
36 /**
37 * Delete membership Blocks.
38 *
39 * @param int $id
40 *
41 * @return bool
42 */
43 public static function del($id) {
44 $dao = new CRM_Member_DAO_MembershipBlock();
45 $dao->id = $id;
46 $result = FALSE;
47 if ($dao->find(TRUE)) {
48 $dao->delete();
49 $result = TRUE;
50 }
51 return $result;
52 }
53
54 }