{% extends admin.getTemplate('base_list_field') %}
{% block field %}
    <div>
	    {# {% if object is instanceof("App\\Entity\\Operation") %} #}
    	{% set objectFlux = null %}
    	{% if field_description.label|lower == 'expediteur' %}
    		{% set objectFlux = object.account.accountableObject == object.flux.expediteur ? null : object.flux.expediteur %}
    	{% elseif field_description.label|lower == 'destinataire' %}
    		{% set objectFlux = object.account.accountableObject == object.flux.destinataire ? null : object.flux.destinataire %}
    	{% elseif field_description.label|lower matches '/^Compte (groupe|comptoir|adherent|prestataire)/i' %}
    		{% set objectFlux = object.account.accountableObject %}
	    {% endif %}
	    {% if objectFlux is not null %}
	        {% if objectFlux is instanceof("App\\Entity\\Adherent") %}
				{% set name = 'Adherent' %}
				{% set routea = 'adherent_edit' %}
			{% elseif objectFlux is instanceof("App\\Entity\\Prestataire") %}
				{% set name = 'Prestataire' %}
				{% set routea = 'prestataire_edit' %}
			{% elseif objectFlux is instanceof("App\\Entity\\Comptoir") %}
				{% set name = 'Comptoir' %}
				{% set routea = 'comptoir_edit' %}
			{% elseif objectFlux is instanceof("App\\Entity\\Groupe") %}
				{% set name = 'Groupe' %}
				{% set routea = 'admin_app_groupe_edit' %}
			{% else %}
				{% set name = '' %}
				{% set routea = '' %}
			{% endif %}

		    {% if routea != '' %}
		        <a class="sonata-link-identifier" href="{{ path(routea, {'id': objectFlux.id}) }}">
		            {{ name ? '('~name~') ' }}{{ value }}
		        </a>
	    	{% else %}
		        {{ value }}
	    	{% endif %}
	    {% endif %}
    </div>
{% endblock %}