Merge pull request #22928 from artfulrobot/artfulrobot-title-double-html-encoding
[civicrm-core.git] / CRM / Contact / BAO / SubscriptionHistory.php
CommitLineData
6a488035
TO
1<?php
2/*
3 +--------------------------------------------------------------------+
bc77d7c0 4 | Copyright CiviCRM LLC. All rights reserved. |
6a488035 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 |
6a488035 9 +--------------------------------------------------------------------+
d25dd0ee 10 */
6a488035
TO
11
12/**
13 *
14 * @package CRM
ca5cec67 15 * @copyright CiviCRM LLC https://civicrm.org/licensing
6a488035
TO
16 */
17
18/**
c037736a 19 * BAO object for crm_email table.
6a488035
TO
20 */
21class CRM_Contact_BAO_SubscriptionHistory extends CRM_Contact_DAO_SubscriptionHistory {
69078420 22
6a488035 23 /**
fe482240 24 * Create a new subscription history record.
6a488035 25 *
77c5b619
TO
26 * @param array $params
27 * Values for the new history record.
6a488035 28 *
a6c01b45
CW
29 * @return object
30 * $history The new history object
6a488035
TO
31 */
32 public static function &create(&$params) {
33 $history = new CRM_Contact_BAO_SubscriptionHistory();
34 $history->date = date('Ymd');
35 $history->copyValues($params);
36 $history->save();
37 return $history;
38 }
39
40 /**
c037736a 41 * Erase a contact's subscription history records.
6a488035 42 *
77c5b619
TO
43 * @param int $id
44 * The contact id.
6a488035
TO
45 */
46 public static function deleteContact($id) {
47 $history = new CRM_Contact_BAO_SubscriptionHistory();
48 $history->contact_id = $id;
49 $history->delete();
50 }
96025800 51
6a488035 52}