{% extends "KnpIpsumBundle:DoctrineOdm:layout.html.twig" %}

{% block content_doctrine %}
    <h1>List of products</h1>

    <p>Here is the list of products from your collection:</p>

    {% if products %}
        <ul>
        {% for product in products %}
            <li>* {{ product.identifyYourselfPlease }} − <a href="{{ path('knp_ipsum_doctrine_odm_delete', {'id': product.id}) }}">DELETE</a></li>
        {% endfor %}
        </ul>
    {% else %}
        <p>− There are no products yet!</p>
    {% endif %}

    <p>You should have a look at <pre>src/Knp/IpsumBundle/Document/Product.php</pre></p>
{% endblock %}

{% set code = code(_self) %}

{% extends "KnpIpsumBundle:DoctrineOdm:layout.html.twig" %}

{% block content_doctrine %}
    <h1>List of products</h1>

    <p>Here is the list of products from your collection:</p>

    {% if products.count %}
        <ul>
        {% for product in products %}
            <li>* {{ product.identifyYourselfPlease }} − <a href="{{ path('knp_ipsum_doctrine_odm_delete', {'id': product.id}) }}">DELETE</a></li>
        {% endfor %}
        </ul>
    {% else %}
        <p>− There are no products yet!</p>
    {% endif %}

    <p>You should have a look at <pre>src/Knp/IpsumBundle/Document/Product.php</pre></p>
{% endblock %}

{% set code = code(_self) %}

Fix to check count and not object before traversal
[MongoDB] Fix to check count and not object before traversal
