Merge pull request #22624 from eileenmcnaughton/mailing
[civicrm-core.git] / CRM / Contribute / BAO / ManagePremiums.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 * @deprecated
17 */
18 class CRM_Contribute_BAO_ManagePremiums extends CRM_Contribute_BAO_Product {
19
20 /**
21 * Class constructor.
22 */
23 public function __construct() {
24 CRM_Core_Error::deprecatedFunctionWarning('CRM_Contribute_BAO_Product::construct');
25 parent::__construct();
26 }
27
28 /**
29 * Fetch object based on array of properties.
30 *
31 * @deprecated
32 * @param array $params
33 * @param array $defaults
34 *
35 * @return CRM_Contribute_BAO_Product
36 */
37 public static function retrieve(&$params, &$defaults) {
38 CRM_Core_Error::deprecatedFunctionWarning('CRM_Contribute_BAO_Product::retrieve');
39 return parent::retrieve($params, $defaults);
40 }
41
42 /**
43 * Update the is_active flag in the db.
44 *
45 * @deprecated
46 * @param int $id
47 * Id of the database record.
48 * @param bool $is_active
49 * Value we want to set the is_active field.
50 *
51 * @return bool
52 */
53 public static function setIsActive($id, $is_active) {
54 CRM_Core_Error::deprecatedFunctionWarning('CRM_Contribute_BAO_Product::setIsActive');
55 return parent::setIsActive($id, $is_active);
56 }
57
58 /**
59 * Add a premium product to the database, and return it.
60 *
61 * @deprecated
62 * @param array $params
63 * Reference array contains the values submitted by the form.
64 * @param array $ids (deprecated)
65 * Reference array contains the id.
66 *
67 * @return CRM_Contribute_DAO_Product
68 */
69 public static function add(&$params, $ids) {
70 CRM_Core_Error::deprecatedFunctionWarning('CRM_Contribute_BAO_Product::create');
71 $id = $params['id'] ?? $ids['premium'] ?? NULL;
72 if ($id) {
73 $params['id'] = $id;
74 }
75 return parent::create($params);
76 }
77
78 /**
79 * Delete premium Types.
80 *
81 * @deprecated
82 * @param int $productID
83 *
84 * @throws \CRM_Core_Exception
85 */
86 public static function del($productID) {
87 CRM_Core_Error::deprecatedFunctionWarning('CRM_Contribute_BAO_Product::del');
88 return parent::del($productID);
89 }
90
91 }