Merge pull request #23361 from eileenmcnaughton/import_comment
[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 32 * @param array $params
014c4014 33 * @param array $defaults
6a488035 34 *
a275d4b6 35 * @return CRM_Contribute_BAO_Product
6a488035 36 */
00be9182 37 public static function retrieve(&$params, &$defaults) {
37828d4f
MW
38 CRM_Core_Error::deprecatedFunctionWarning('CRM_Contribute_BAO_Product::retrieve');
39 return parent::retrieve($params, $defaults);
6a488035
TO
40 }
41
42 /**
fe482240 43 * Update the is_active flag in the db.
6a488035 44 *
37828d4f 45 * @deprecated
014c4014
TO
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.
6a488035 50 *
de22d771 51 * @return bool
6a488035 52 */
00be9182 53 public static function setIsActive($id, $is_active) {
37828d4f
MW
54 CRM_Core_Error::deprecatedFunctionWarning('CRM_Contribute_BAO_Product::setIsActive');
55 return parent::setIsActive($id, $is_active);
6a488035
TO
56 }
57
58 /**
706f6a01 59 * Add a premium product to the database, and return it.
6a488035 60 *
37828d4f 61 * @deprecated
014c4014
TO
62 * @param array $params
63 * Reference array contains the values submitted by the form.
c2e7de48 64 * @param array $ids (deprecated)
014c4014 65 * Reference array contains the id.
6a488035 66 *
706f6a01 67 * @return CRM_Contribute_DAO_Product
6a488035 68 */
c2e7de48 69 public static function add(&$params, $ids) {
32f27499 70 CRM_Core_Error::deprecatedFunctionWarning('CRM_Contribute_BAO_Product::create');
8df1a020 71 $id = $params['id'] ?? $ids['premium'] ?? NULL;
32f27499 72 if ($id) {
73 $params['id'] = $id;
74 }
75 return parent::create($params);
6a488035
TO
76 }
77
78 /**
fe482240 79 * Delete premium Types.
6a488035 80 *
37828d4f 81 * @deprecated
6a488035 82 * @param int $productID
de22d771 83 *
84 * @throws \CRM_Core_Exception
6a488035 85 */
00be9182 86 public static function del($productID) {
37828d4f
MW
87 CRM_Core_Error::deprecatedFunctionWarning('CRM_Contribute_BAO_Product::del');
88 return parent::del($productID);
6a488035 89 }
96025800 90
6a488035 91}