File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -48,3 +48,5 @@ services:
4848 BD\EzPlatformGraphQLBundle\DomainContent\FieldValueBuilder\SelectionFieldValueBuilder :
4949 tags :
5050 - {name: ezplatform_graphql.field_value_builder, type: 'ezselection'}
51+
52+ BD\EzPlatformGraphQLBundle\Schema\ImagesVariationsBuilder : ~
Original file line number Diff line number Diff line change 1+ <?php
2+ namespace BD \EzPlatformGraphQLBundle \Schema ;
3+
4+ use eZ \Bundle \EzPublishCoreBundle \DependencyInjection \Configuration \ConfigResolver ;
5+
6+ /**
7+ * Generates the ImageVariationIdentifier enum that indexes images variations identifiers.
8+ */
9+ class ImagesVariationsBuilder implements SchemaBuilder
10+ {
11+ /**
12+ * @var ConfigResolver
13+ */
14+ private $ configResolver ;
15+
16+ public function __construct (ConfigResolver $ configResolver )
17+ {
18+ $ this ->configResolver = $ configResolver ;
19+ }
20+
21+ public function build (array &$ schema )
22+ {
23+ $ schema ['ImageVariationIdentifier ' ] = [
24+ 'type ' => 'enum ' ,
25+ 'config ' => [
26+ 'values ' => []
27+ ]
28+ ];
29+
30+ $ values =& $ schema ['ImageVariationIdentifier ' ]['config ' ]['values ' ];
31+
32+ foreach (array_keys ($ this ->configResolver ->getParameter ('image_variations ' )) as $ variationIdentifier ) {
33+ $ values [$ variationIdentifier ] = [];
34+ }
35+ }
36+ }
You can’t perform that action at this time.
0 commit comments