JacksonRiver/springboard_modules — pull request #252 by benclark (2013-04-22 16:38:15+00:00)
Title: Refactoring `_fundraiser_webform_get_components_by_nid()` and its child ...

...functions to reduce the number of database queries.

1) Since `_fundraiser_webform_get_components_by_nid()` is often called at least once per page request, we already have access to the results of `SELECT * FROM {webform_component} WHERE nid = :nid`. There's also now a static cache in this function to avoid duplicate queries. Secondly, I added a second argument for returning an array keyed by `form_key`, where it was previously a numeric index.

2) `_fundraiser_webform_get_components_by_keys()` is refactored to call `_fundraiser_webform_get_components_by_nid()` and returns an array of component objects from the requested form keys.

3) `_fundraiser_webform_get_component_by_nid_key()` is refactored to call `_fundraiser_webform_get_components_by_keys()` and returns a single component object from that array.