I think getTemplateData wins the dubious prize of "longest method in Camdram 2.0"(!) I'm struggling to read through it all and work out exactly what it does, so but at a guess maybe:
 * Create a service elsewhere that deals with collecting the data where it's easier to split it up into separate methods
 * I'm suspicious of the need to do custom sorting in PHP - is it possible to do this in the DB, even if it means doing more DB queries.
 * It's possible to do a small amount of filtering/sorting in entity getters using Criteria objects - e.g. getRolesByType() in Show I think.
 * If it's absolutely necessary to build a custom data model rather than use the existing entities, maybe create classes to represent it rather than a large array.