/** * * The function extracts all the params it needs to create a * discount object. the params array contains additional unused name/value * pairs * * @param array $params (reference) an assoc array of name/value pairs * * @return object CRM_Core_DAO_Discount object on success, otherwise null * @access public * @static */ static function add(&$params) { $discount = new CRM_Core_DAO_Discount(); $discount->copyValues($params); $discount->save(); return $discount; }