
    /**
{% block phpdoc_method_header %}
     * Lists all {{ entity }} entities.
{% endblock phpdoc_method_header %}
     *
{% block phpdoc_method_annotations %}
{% if 'annotation' == format %}
     * @Route("/", name="{{ route_name_prefix }}")
     * @Method("GET")
     * @Template()
{% endif %}
{% endblock phpdoc_method_annotations %}
     */
{% block method_definition %}
    public function indexAction()
{% endblock method_definition %}
    {
{% block method_body %}
        $em = $this->getDoctrine()->getManager();

        $entities = $em->getRepository('{{ bundle }}:{{ entity }}')->findAll();
{% endblock method_body %}

{% block method_return %}
{% if 'annotation' == format %}
        return array(
            'entities' => $entities,
        );
{% else %}
        return $this->render('{{ bundle }}:{{ entity|replace({'\\': '/'}) }}:index.html.twig', array(
            'entities' => $entities,
        ));
{% endif %}
{% endblock method_return %}
    }
