Merge pull request #22558 from eileenmcnaughton/coleman
[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 * (reference ) an assoc array of name/value pairs.
34 * @param array $defaults
35 * (reference ) an assoc array to hold the flattened values.
36 *
37 * @return CRM_Contribute_BAO_Product
38 */
39 public static function retrieve(&$params, &$defaults) {
40 CRM_Core_Error::deprecatedFunctionWarning('CRM_Contribute_BAO_Product::retrieve');
41 return parent::retrieve($params, $defaults);
42 }
43
44 /**
45 * Update the is_active flag in the db.
46 *
47 * @deprecated
48 * @param int $id
49 * Id of the database record.
50 * @param bool $is_active
51 * Value we want to set the is_active field.
52 *
53 * @return bool
54 */
55 public static function setIsActive($id, $is_active) {
56 CRM_Core_Error::deprecatedFunctionWarning('CRM_Contribute_BAO_Product::setIsActive');
57 return parent::setIsActive($id, $is_active);
58 }
59
60 /**
61 * Add a premium product to the database, and return it.
62 *
63 * @deprecated
64 * @param array $params
65 * Reference array contains the values submitted by the form.
66 * @param array $ids (deprecated)
67 * Reference array contains the id.
68 *
69 * @return CRM_Contribute_DAO_Product
70 */
71 public static function add(&$params, $ids) {
72 CRM_Core_Error::deprecatedFunctionWarning('CRM_Contribute_BAO_Product::create');
73 $id = $params['id'] ?? $ids['premium'] ?? NULL;
74 if ($id) {
75 $params['id'] = $id;
76 }
77 return parent::create($params);
78 }
79
80 /**
81 * Delete premium Types.
82 *
83 * @deprecated
84 * @param int $productID
85 *
86 * @throws \CRM_Core_Exception
87 */
88 public static function del($productID) {
89 CRM_Core_Error::deprecatedFunctionWarning('CRM_Contribute_BAO_Product::del');
90 return parent::del($productID);
91 }
92
93 }