@@ -66,6 +66,13 @@ class RawListImplementation extends AbstractFusionObject
6666 */
6767 protected $ assetUsage ;
6868
69+ /**
70+ * Internal cache for the ignored filenames.
71+ *
72+ * @var array
73+ */
74+ protected $ ignoreFilenames ;
75+
6976 /**
7077 * Internal cache for the used dimensions
7178 *
@@ -83,7 +90,7 @@ class RawListImplementation extends AbstractFusionObject
8390 /**
8491 * Internal cache for the context
8592 *
86- * @var array
93+ * @var object
8794 */
8895 protected $ context ;
8996
@@ -94,6 +101,24 @@ class RawListImplementation extends AbstractFusionObject
94101 */
95102 protected $ currentSiteNodeIdentifierArray ;
96103
104+ protected function getIgnoreFilenames (): array
105+ {
106+ $ ignoreFilenames = $ this ->fusionValue ('ignoreFilenames ' );
107+
108+ if (!is_array ($ ignoreFilenames )) {
109+ return [];
110+ }
111+
112+ $ result = [];
113+ foreach ($ ignoreFilenames as $ ignoredFile => $ value ) {
114+ if ($ value ) {
115+ $ result [] = strtolower ($ ignoredFile );
116+ }
117+ }
118+
119+ return array_unique ($ result );
120+ }
121+
97122 /**
98123 * Returns the items as result of the fusion object.
99124 *
@@ -113,6 +138,7 @@ public function evaluate(): array
113138 $ this ->workspace = $ startingPoint ->getWorkspace ()->getName ();
114139 $ this ->startingPoint = $ startingPoint ;
115140 $ this ->context = $ startingPoint ->getContext ();
141+ $ this ->ignoreFilenames = $ this ->getIgnoreFilenames ();
116142 if (isset ($ this ->items )) {
117143 return $ this ->items ;
118144 }
@@ -336,7 +362,7 @@ protected function assetHasCorrectMediaType(?AssetInterface $asset): bool
336362 }
337363
338364 /**
339- * @param array $entityUsage
365+ * @param object $entityUsage
340366 * @return array|null
341367 */
342368 protected function entityUsage ($ entityUsage ): ?array
@@ -370,6 +396,11 @@ protected function entityUsage($entityUsage): ?array
370396 /** @var AssetInterface $asset */
371397 $ asset = $ this ->assetRepository ->findByIdentifier ($ id );
372398
399+ $ filename = strtolower ($ asset ->getResource ()->getFilename ());
400+ if (in_array ($ filename , $ this ->ignoreFilenames )) {
401+ return null ;
402+ }
403+
373404 if (!$ this ->assetHasCorrectMediaType ($ asset )) {
374405 return null ;
375406 }
0 commit comments