7
7
use PBaszak \UltraMapper \Blueprint \Application \Model \Assets \ClassBlueprint ;
8
8
use PBaszak \UltraMapper \Blueprint \Application \Model \Assets \PropertyBlueprint ;
9
9
use PBaszak \UltraMapper \Blueprint \Application \Model \Blueprint ;
10
+ use PBaszak \UltraMapper \Mapper \Application \Attribute \Discriminator ;
10
11
use PBaszak \UltraMapper \Mapper \Application \Model \Context ;
11
12
use PBaszak \UltraMapper \Mapper \Domain \Model \Process ;
12
13
use PBaszak \UltraMapper \Mapper \Domain \Modules \Extender \Contract \ExtenderStrategyInterface ;
@@ -18,21 +19,26 @@ class DiscriminatorExtender implements ExtenderStrategyInterface
18
19
19
20
public function extend (Blueprint $ blueprint , Process $ process , Context $ context ): bool
20
21
{
21
- $ this ->extended = false ;
22
22
$ this ->blueprint = $ blueprint ;
23
+ $ this ->extended = false ;
23
24
24
- array_walk (
25
- $ blueprint ->blueprints ,
26
- fn (ClassBlueprint $ classBlueprint ) => $ this ->handleClassBlueprint ($ classBlueprint , $ process , $ context )
27
- );
25
+ foreach ($ process ->processes as $ processType ) {
26
+ array_walk (
27
+ $ blueprint ->blueprints ,
28
+ fn (ClassBlueprint $ classBlueprint ) => $ this ->handleClassBlueprint ($ classBlueprint , $ processType , $ context )
29
+ );
30
+ }
28
31
29
32
return $ this ->extended ;
30
33
}
31
34
32
- private function handleClassBlueprint (ClassBlueprint $ blueprint , Process $ process , Context $ context ): void
35
+ private function handleClassBlueprint (ClassBlueprint $ blueprint , string $ process , Context $ context ): void
33
36
{
34
37
/** @var PropertyBlueprint $property */
35
38
foreach ($ blueprint ->properties as $ property ) {
39
+ if (empty ($ discriminatorAttr = $ property ->getAttributes (Discriminator::class, $ process ))) {
40
+ continue ;
41
+ }
36
42
}
37
43
}
38
44
}
0 commit comments