CRM-17772 refactor main export processing function
authoreileen <emcnaughton@wikimedia.org>
Tue, 5 Jan 2016 10:03:47 +0000 (23:03 +1300)
committereileen <emcnaughton@wikimedia.org>
Tue, 5 Jan 2016 10:37:00 +0000 (23:37 +1300)
commit12a369939595443262a9473d681b5a9371da869f
tree5757d466ea077c1ddf637b112b96ec801a5a9a4c
parent36f38fe7af076907be5e436fa160d0aab92fedd5
CRM-17772 refactor main export processing function

This is a first refactor on the exportComponents function with the goal being to
a) provide a (small) start on getting testing going
b) move some of the php level processing out of the main ->fetch loop. Since this is iterated once per row it has
a significant impact on large exports. When doing profiling I noticed that the munge function was taking
quite a bit of time. I was investigating a reported increased slowness on upgrade & that had been introduced since the previous version and
the iteration happens has to help. Although I still had to leave some true old uglinesses & introduced some new ones I think
this is on the right track - ie. in general we should make the  array match the fields in the
query unless there is good reaon for extra handling. This conclusion was also the driver for the test I added.

Don't even ask about that relationship block! But if we got rid of that we could structure  as 'dao_query_field_name' => .
CRM/Export/BAO/Export.php
tests/phpunit/CRM/Export/BAO/ExportTest.php