5
5
namespace PBaszak \UltraMapper \Mapper \Application \Attribute ;
6
6
7
7
use PBaszak \UltraMapper \Mapper \Application \Contract \AttributeInterface ;
8
- use PBaszak \UltraMapper \Mapper \Application \Contract \TypeInterface ;
9
8
use PBaszak \UltraMapper \Mapper \Application \Exception \ThrowAttributeValidationExceptionTrait ;
9
+ use PBaszak \UltraMapper \Mapper \Domain \Model \Process ;
10
10
11
- #[\Attribute(\Attribute::TARGET_PROPERTY )]
11
+ #[\Attribute(\Attribute::TARGET_PROPERTY | \Attribute:: TARGET_PARAMETER | \Attribute:: IS_REPEATABLE )]
12
12
class TargetProperty implements AttributeInterface
13
13
{
14
14
use ThrowAttributeValidationExceptionTrait;
@@ -19,10 +19,10 @@ class TargetProperty implements AttributeInterface
19
19
public const TRANSFORMATION = 8 ; // 1000
20
20
21
21
public const PROCESS_TYPE_MAP = [
22
- TypeInterface ::DENORMALIZATION_PROCESS => self ::DENORMALIZATION ,
23
- TypeInterface ::NORMALIZATION_PROCESS => self ::NORMALIZATION ,
24
- TypeInterface ::MAPPING_PROCESS => self ::MAPPING ,
25
- TypeInterface ::TRANSFORMATION_PROCESS => self ::TRANSFORMATION ,
22
+ Process ::DENORMALIZATION_PROCESS => self ::DENORMALIZATION ,
23
+ Process ::NORMALIZATION_PROCESS => self ::NORMALIZATION ,
24
+ Process ::MAPPING_PROCESS => self ::MAPPING ,
25
+ Process ::TRANSFORMATION_PROCESS => self ::TRANSFORMATION ,
26
26
];
27
27
28
28
/**
@@ -33,14 +33,14 @@ class TargetProperty implements AttributeInterface
33
33
*/
34
34
public function __construct (
35
35
public readonly string $ name ,
36
- public readonly int $ useNameFor = self ::MAPPING | self ::DENORMALIZATION | self ::NORMALIZATION ,
36
+ public readonly int $ useNameFor = self ::DENORMALIZATION | self ::NORMALIZATION | self ::TRANSFORMATION | self :: MAPPING ,
37
37
public readonly ?string $ path = null ,
38
- public readonly int $ usePathFor = self ::DENORMALIZATION ,
38
+ public readonly int $ usePathFor = self ::DENORMALIZATION | self :: NORMALIZATION | self :: TRANSFORMATION | self :: MAPPING ,
39
39
public readonly array $ options = []
40
40
) {
41
41
}
42
42
43
- public function validate (\ReflectionProperty |\ReflectionClass $ reflection ): void
43
+ public function validate (\ReflectionProperty |\ReflectionParameter | \ ReflectionClass $ reflection ): void
44
44
{
45
45
// there cannot be two target properties with the same processType
46
46
// todo implement
0 commit comments