From 8af909216c965611b5378bf19b438d5d53b3a566 Mon Sep 17 00:00:00 2001 From: pbarroca <pbarroca@afi-sa.fr> Date: Tue, 24 Jan 2017 14:40:42 +0100 Subject: [PATCH] dev #53936 : apply to used type docs --- library/ZendAfi/View/Helper/TagListeCoches.php | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/library/ZendAfi/View/Helper/TagListeCoches.php b/library/ZendAfi/View/Helper/TagListeCoches.php index 83760f3d6dc..1a6eb00e960 100644 --- a/library/ZendAfi/View/Helper/TagListeCoches.php +++ b/library/ZendAfi/View/Helper/TagListeCoches.php @@ -225,7 +225,12 @@ class ZendAfi_View_Helper_TagListeCochesSourceDocType extends ZendAfi_View_Helpe protected function getInstances() { - $instances = parent::getInstances(); + $instances = array_filter( + parent::getInstances(), + function($instance) { + return 0 < Class_Notice::countBy(['type_doc' => $instance->getId()]); + }); + usort($instances, function($a, $b) { @@ -234,7 +239,6 @@ class ZendAfi_View_Helper_TagListeCochesSourceDocType extends ZendAfi_View_Helpe return $instances; } - } -- GitLab