| GNU Affero General Public License or the licensing of CiviCRM, |
| see the CiviCRM license FAQ at http://civicrm.org/licensing |
+--------------------------------------------------------------------+
-*/
+ */
/**
*
class CRM_Contribute_BAO_ManagePremiums extends CRM_Contribute_DAO_Product {
/**
- * Static holder for the default LT
+ * Static holder for the default LT.
*/
static $_defaultContributionType = NULL;
/**
- * Class constructor
+ * Class constructor.
*/
- function __construct() {
+ public function __construct() {
parent::__construct();
}
/**
- * Fetch object based on array of properties
+ * Fetch object based on array of properties.
*
- * @param array $params (reference ) an assoc array of name/value pairs
- * @param array $defaults (reference ) an assoc array to hold the flattened values
+ * @param array $params
+ * (reference ) an assoc array of name/value pairs.
+ * @param array $defaults
+ * (reference ) an assoc array to hold the flattened values.
*
- * @return CRM_Contribute_BAO_ManagePremium object
- * @access public
- * @static
+ * @return CRM_Contribute_BAO_ManagePremium
*/
- static function retrieve(&$params, &$defaults) {
+ public static function retrieve(&$params, &$defaults) {
$premium = new CRM_Contribute_DAO_Product();
$premium->copyValues($params);
if ($premium->find(TRUE)) {
}
/**
- * Update the is_active flag in the db
+ * Update the is_active flag in the db.
*
- * @param int $id id of the database record
- * @param boolean $is_active value we want to set the is_active field
+ * @param int $id
+ * Id of the database record.
+ * @param bool $is_active
+ * Value we want to set the is_active field.
*
- * @return Object DAO object on sucess, null otherwise
- * @static
+ * @return Object
+ * DAO object on sucess, null otherwise
*/
- static function setIsActive($id, $is_active) {
+ public static function setIsActive($id, $is_active) {
if (!$is_active) {
$dao = new CRM_Contribute_DAO_PremiumsProduct();
$dao->product_id = $id;
}
/**
- * add the financial types
+ * add the financial types.
*
- * @param array $params reference array contains the values submitted by the form
- * @param array $ids reference array contains the id
+ * @param array $params
+ * Reference array contains the values submitted by the form.
+ * @param array $ids
+ * Reference array contains the id.
*
- * @access public
- * @static
*
* @return object
*/
- static function add(&$params, &$ids) {
+ public static function add(&$params, &$ids) {
// CRM-14283 - strip protocol and domain from image URLs
$image_type = array('image', 'thumbnail');
foreach ($image_type as $key) {
}
/**
- * Delete premium Types
+ * Delete premium Types.
*
* @param int $productID
- * @static
*/
-
- static function del($productID) {
+ public static function del($productID) {
//check dependencies
$premiumsProduct = new CRM_Contribute_DAO_PremiumsProduct();
$premiumsProduct->product_id = $productID;
return CRM_Utils_System::redirect(CRM_Utils_System::url('civicrm/admin/contribute/managePremiums', 'reset=1&action=browse'));
}
- //delete from financial Type table
+ //delete from financial Type table
$premium = new CRM_Contribute_DAO_Product();
$premium->id = $productID;
$premium->delete();
}
-}
+}