|
1
|
|
|
<?php |
|
2
|
|
|
|
|
3
|
|
|
namespace Papper\Internal; |
|
4
|
|
|
|
|
5
|
|
|
use Papper\MappingOptionsInterface; |
|
6
|
|
|
use Papper\NamingConvention\PascalCaseNamingConvention; |
|
7
|
|
|
use Papper\NamingConventionsInterface; |
|
8
|
|
|
|
|
9
|
|
|
class MappingOptions implements MappingOptionsInterface |
|
10
|
|
|
{ |
|
11
|
|
|
/** |
|
12
|
|
|
* @var NamingConventionsInterface |
|
13
|
|
|
*/ |
|
14
|
|
|
private $sourceMemberNamingConvention; |
|
15
|
|
|
/** |
|
16
|
|
|
* @var NamingConventionsInterface |
|
17
|
|
|
*/ |
|
18
|
|
|
private $destinationMemberNamingConvention; |
|
19
|
|
|
/** |
|
20
|
|
|
* @var string[] |
|
21
|
|
|
*/ |
|
22
|
|
|
private $sourcePrefixes; |
|
23
|
|
|
/** |
|
24
|
|
|
* @var string[] |
|
25
|
|
|
*/ |
|
26
|
|
|
private $destinationPrefixes; |
|
27
|
|
|
|
|
28
|
|
|
public function __construct() |
|
29
|
|
|
{ |
|
30
|
|
|
$this->sourceMemberNamingConvention = $this->destinationMemberNamingConvention = new PascalCaseNamingConvention(); |
|
31
|
|
|
$this->sourcePrefixes = array('get'); |
|
32
|
|
|
$this->destinationPrefixes = array('set'); |
|
33
|
|
|
} |
|
34
|
|
|
|
|
35
|
|
|
public function getSourceMemberNamingConvention() |
|
36
|
|
|
{ |
|
37
|
|
|
return $this->sourceMemberNamingConvention; |
|
38
|
|
|
} |
|
39
|
|
|
|
|
40
|
|
|
public function setSourceMemberNamingConvention(NamingConventionsInterface $sourceMemberNamingConvention) |
|
41
|
|
|
{ |
|
42
|
|
|
$this->sourceMemberNamingConvention = $sourceMemberNamingConvention; |
|
43
|
|
|
return $this; |
|
44
|
|
|
} |
|
45
|
|
|
|
|
46
|
|
|
public function getDestinationMemberNamingConvention() |
|
47
|
|
|
{ |
|
48
|
|
|
return $this->destinationMemberNamingConvention; |
|
49
|
|
|
} |
|
50
|
|
|
|
|
51
|
|
|
public function setDestinationMemberNamingConvention(NamingConventionsInterface $destinationMemberNamingConvention) |
|
52
|
|
|
{ |
|
53
|
|
|
$this->destinationMemberNamingConvention = $destinationMemberNamingConvention; |
|
54
|
|
|
return $this; |
|
55
|
|
|
} |
|
56
|
|
|
|
|
57
|
|
|
public function getSourcePrefixes() |
|
58
|
|
|
{ |
|
59
|
|
|
return $this->sourcePrefixes; |
|
60
|
|
|
} |
|
61
|
|
|
|
|
62
|
|
|
public function setSourcePrefixes(array $sourcePrefixes) |
|
63
|
|
|
{ |
|
64
|
|
|
$this->sourcePrefixes = $sourcePrefixes; |
|
65
|
|
|
return $this; |
|
66
|
|
|
} |
|
67
|
|
|
|
|
68
|
|
|
public function getDestinationPrefixes() |
|
69
|
|
|
{ |
|
70
|
|
|
return $this->destinationPrefixes; |
|
71
|
|
|
} |
|
72
|
|
|
|
|
73
|
|
|
public function setDestinationPrefixes(array $destinationPrefixes) |
|
74
|
|
|
{ |
|
75
|
|
|
$this->destinationPrefixes = $destinationPrefixes; |
|
76
|
|
|
return $this; |
|
77
|
|
|
} |
|
78
|
|
|
} |
|
79
|
|
|
|