Merge pull request #14577 from mattwire/type_consolidation
[civicrm-core.git] / CRM / Contribute / BAO / ManagePremiums.php
1 <?php
2 /*
3 +--------------------------------------------------------------------+
4 | CiviCRM version 5 |
5 +--------------------------------------------------------------------+
6 | Copyright CiviCRM LLC (c) 2004-2019 |
7 +--------------------------------------------------------------------+
8 | This file is a part of CiviCRM. |
9 | |
10 | CiviCRM is free software; you can copy, modify, and distribute it |
11 | under the terms of the GNU Affero General Public License |
12 | Version 3, 19 November 2007 and the CiviCRM Licensing Exception. |
13 | |
14 | CiviCRM is distributed in the hope that it will be useful, but |
15 | WITHOUT ANY WARRANTY; without even the implied warranty of |
16 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. |
17 | See the GNU Affero General Public License for more details. |
18 | |
19 | You should have received a copy of the GNU Affero General Public |
20 | License and the CiviCRM Licensing Exception along |
21 | with this program; if not, contact CiviCRM LLC |
22 | at info[AT]civicrm[DOT]org. If you have questions about the |
23 | GNU Affero General Public License or the licensing of CiviCRM, |
24 | see the CiviCRM license FAQ at http://civicrm.org/licensing |
25 +--------------------------------------------------------------------+
26 */
27
28 /**
29 *
30 * @package CRM
31 * @copyright CiviCRM LLC (c) 2004-2019
32 * @deprecated
33 */
34 class CRM_Contribute_BAO_ManagePremiums extends CRM_Contribute_BAO_Product {
35
36 /**
37 * Class constructor.
38 */
39 public function __construct() {
40 CRM_Core_Error::deprecatedFunctionWarning('CRM_Contribute_BAO_Product::construct');
41 parent::__construct();
42 }
43
44 /**
45 * Fetch object based on array of properties.
46 *
47 * @deprecated
48 * @param array $params
49 * (reference ) an assoc array of name/value pairs.
50 * @param array $defaults
51 * (reference ) an assoc array to hold the flattened values.
52 *
53 * @return CRM_Contribute_BAO_Product
54 */
55 public static function retrieve(&$params, &$defaults) {
56 CRM_Core_Error::deprecatedFunctionWarning('CRM_Contribute_BAO_Product::retrieve');
57 return parent::retrieve($params, $defaults);
58 }
59
60 /**
61 * Update the is_active flag in the db.
62 *
63 * @deprecated
64 * @param int $id
65 * Id of the database record.
66 * @param bool $is_active
67 * Value we want to set the is_active field.
68 *
69 * @return bool
70 */
71 public static function setIsActive($id, $is_active) {
72 CRM_Core_Error::deprecatedFunctionWarning('CRM_Contribute_BAO_Product::setIsActive');
73 return parent::setIsActive($id, $is_active);
74 }
75
76 /**
77 * Add a premium product to the database, and return it.
78 *
79 * @deprecated
80 * @param array $params
81 * Reference array contains the values submitted by the form.
82 * @param array $ids (deprecated)
83 * Reference array contains the id.
84 *
85 * @return CRM_Contribute_DAO_Product
86 */
87 public static function add(&$params, $ids) {
88 CRM_Core_Error::deprecatedFunctionWarning('CRM_Contribute_BAO_Product::create');
89 $id = CRM_Utils_Array::value('id', $params, CRM_Utils_Array::value('premium', $ids));
90 if ($id) {
91 $params['id'] = $id;
92 }
93 return parent::create($params);
94 }
95
96 /**
97 * Delete premium Types.
98 *
99 * @deprecated
100 * @param int $productID
101 *
102 * @throws \CRM_Core_Exception
103 */
104 public static function del($productID) {
105 CRM_Core_Error::deprecatedFunctionWarning('CRM_Contribute_BAO_Product::del');
106 return parent::del($productID);
107 }
108
109 }