/** * 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 * * @internal param array $ids the array that holds all the db ids * * @return object CRM_Price_BAO_PriceField object * @access public * @static */ static function add(&$params) { $priceFieldBAO = new CRM_Price_BAO_PriceField(); $priceFieldBAO->copyValues($params); if ($id = CRM_Utils_Array::value('id', $params)) { $priceFieldBAO->id = $id; } $priceFieldBAO->save(); return $priceFieldBAO; }