* @static
*/
static function create(&$params) {
+ if(empty($params['id']) && empty($params['name'])) {
+ $params['name'] = CRM_Utils_String::munge($params['label'], '_', 242);
+ }
$transaction = new CRM_Core_Transaction();
$priceField = self::add($params);
* @access public
* @static
*/
- static function &add(&$params, $ids) {
+ static function add(&$params, $ids = array()) {
$fieldValueBAO = new CRM_Price_BAO_PriceFieldValue();
$fieldValueBAO->copyValues($params);
* @access public
* @static
*/
- static function create(&$params, $ids) {
+ static function create(&$params, $ids = array()) {
if (!is_array($params) || empty($params)) {
return;
}
+ if(empty($params['id']) && empty($params['name'])) {
+ $params['name'] = CRM_Utils_String::munge($params['label'], '_', 242);
+ }
if ($id = CRM_Utils_Array::value('id', $ids)) {
if (isset($params['name']))unset($params['name']);
*
* @param int $fieldId Price field id
*
- * @return boolean
*
* @access public
* @static
*/
static function deleteValues($fieldId) {
if (!$fieldId) {
- return FALSE;
+ return;
}
$fieldValueDAO = new CRM_Price_DAO_PriceFieldValue();
* @param String $entityTable entity table
* @param String $financialTypeID financial type id
*
- * @return bool
* @access public
* @static
*/
static function updateFinancialType($entityId, $entityTable, $financialTypeID) {
if (!$entityId || !$entityTable || !$financialTypeID) {
- return FALSE;
+ return;
}
$params = array(
1 => array($entityId, 'Integer'),