Merge pull request #17459 from civicrm/5.26
[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 * $Id$
17 *
18 */
19 class CRM_Member_BAO_MembershipBlock extends CRM_Member_DAO_MembershipBlock {
20
21 /**
22 * Class constructor.
23 */
24 public function __construct() {
25 parent::__construct();
26 }
27
28 /**
29 * Create or update a MembershipBlock.
30 *
31 * @param array $params
32 * @return CRM_Member_DAO_MembershipBlock
33 */
34 public static function create($params) {
35 return self::writeRecord($params);
36 }
37
38 /**
39 * Delete membership Blocks.
40 *
41 * @param int $id
42 *
43 * @return bool
44 */
45 public static function del($id) {
46 $dao = new CRM_Member_DAO_MembershipBlock();
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 }