/** * takes an associative array and creates a price field object * * the function extract all the params it needs to initialize the create a * price field object. the params array could contain additional unused name/value * pairs * * @param array $params (reference ) an assoc array of name/value pairs * @param array $ids the array that holds all the db ids * * @return object CRM_Price_BAO_Field object * @access public * @static */ static function &add(&$params, $ids) { $priceFieldBAO = new CRM_Price_BAO_Field(); $priceFieldBAO->copyValues($params); if ($id = CRM_Utils_Array::value('id', $ids)) { $priceFieldBAO->id = $id; } $priceFieldBAO->save(); return $priceFieldBAO; }