using doctrine to generate datastructure