1 | <?php |
||
16 | abstract class CompoundParameter implements CompoundParameterInterface |
||
17 | { |
||
18 | /** |
||
19 | * Maps a human readable name used when initializing the compound parameter into |
||
20 | * the real name used in the payload. |
||
21 | * |
||
22 | * @var array |
||
23 | */ |
||
24 | protected $parameterNameMapper = []; |
||
25 | |||
26 | /** |
||
27 | * Contains the required parameters for the compound parameters. |
||
28 | * They are in the same human readable name as in the mapper above. |
||
29 | * |
||
30 | * @var array |
||
31 | */ |
||
32 | protected $requiredParameters = []; |
||
33 | |||
34 | /** |
||
35 | * After translating the human readable names into the payload ones, this collections |
||
36 | * contains the map for the payload names and the values to be sent. |
||
37 | * |
||
38 | * @var array |
||
39 | */ |
||
40 | protected $parameters = []; |
||
41 | |||
42 | /** |
||
43 | * After translating the human readable names into the payload ones, this collections |
||
44 | * contains the map for the payload names and the values to be sent. |
||
45 | * |
||
46 | * @var array |
||
47 | */ |
||
48 | protected $readableParameters = []; |
||
49 | |||
50 | |||
51 | /** |
||
52 | * Validates the required parameters are passed, then translates using the mapper to later save |
||
53 | * along with the values. |
||
54 | * |
||
55 | * @param array $compoundData |
||
56 | * |
||
57 | * @throws InvalidCompoundParameterException |
||
58 | */ |
||
59 | public function __construct(array $compoundData) |
||
72 | |||
73 | /** |
||
74 | * @inheritDoc |
||
75 | */ |
||
76 | public function getParameters() |
||
80 | |||
81 | /** |
||
82 | * @inheritDoc |
||
83 | */ |
||
84 | public function getReadableParameters() |
||
88 | |||
89 | /** |
||
90 | * Translates the human readable names into the payload ones and saves them along with the values. |
||
91 | * |
||
92 | * @param array $compoundData |
||
93 | * @throws \InvalidArgumentException |
||
94 | */ |
||
95 | protected function saveCompoundParameterData(array $compoundData) |
||
119 | } |
||
120 |