[ticket/12710] Fix foreach generation

PHPBB3-12710
[ticket/12710] Pass the original column data to the create function

PHPBB3-12710
[ticket/12710] Prefix column so it does not start with a number

PHPBB3-12710