/** * 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. * * @return CRM_Upgrade_Snapshot_V4p2_Price_BAO_Field */ public static function &add(&$params) { $priceFieldBAO = new CRM_Upgrade_Snapshot_V4p2_Price_BAO_Field(); $priceFieldBAO->copyValues($params); if ($id = CRM_Utils_Array::value('id', $params)) { $priceFieldBAO->id = $id; } $priceFieldBAO->save(); return $priceFieldBAO; }