3 +--------------------------------------------------------------------+
5 +--------------------------------------------------------------------+
6 | Copyright CiviCRM LLC (c) 2004-2018 |
7 +--------------------------------------------------------------------+
8 | This file is a part of CiviCRM. |
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. |
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. |
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 +--------------------------------------------------------------------+
31 * @copyright CiviCRM LLC (c) 2004-2018
34 class CRM_Contribute_BAO_ManagePremiums
extends CRM_Contribute_BAO_Product
{
39 public function __construct() {
40 CRM_Core_Error
::deprecatedFunctionWarning('CRM_Contribute_BAO_Product::construct');
41 parent
::__construct();
45 * Fetch object based on array of properties.
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.
53 * @return CRM_Contribute_BAO_Product
55 public static function retrieve(&$params, &$defaults) {
56 CRM_Core_Error
::deprecatedFunctionWarning('CRM_Contribute_BAO_Product::retrieve');
57 return parent
::retrieve($params, $defaults);
61 * Update the is_active flag in the db.
65 * Id of the database record.
66 * @param bool $is_active
67 * Value we want to set the is_active field.
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);
77 * Add a premium product to the database, and return it.
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.
85 * @return CRM_Contribute_DAO_Product
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));
93 return parent
::create($params);
97 * Delete premium Types.
100 * @param int $productID
102 * @throws \CRM_Core_Exception
104 public static function del($productID) {
105 CRM_Core_Error
::deprecatedFunctionWarning('CRM_Contribute_BAO_Product::del');
106 return parent
::del($productID);