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