public function getListJSON(TypeTemplate $template) { /** @var CriteriaTemplate[] $templates */ $templates = $this->createQuery('ct')->where('ct.template_id = ?', $template->id)->execute(); $result = array(); foreach ($templates as $template) { $result[] = $template->getRowData(); } return json_encode($result); }