1 | <?php |
||
35 | class ModuleXmlConfiguration implements ModuleConfigurationInterface |
||
36 | { |
||
37 | |||
38 | /** |
||
39 | * The module's class name. |
||
40 | * |
||
41 | * @var string |
||
42 | */ |
||
43 | protected $type; |
||
44 | |||
45 | /** |
||
46 | * The module parameters. |
||
47 | * |
||
48 | * @var array |
||
49 | */ |
||
50 | protected $params = array(); |
||
51 | |||
52 | /** |
||
53 | * Constructs config |
||
54 | * |
||
55 | * @param \SimpleXMLElement $node The simple xml element used to build config |
||
56 | */ |
||
57 | public function __construct($node) |
||
64 | |||
65 | /** |
||
66 | * Returns the module's class name. |
||
67 | * |
||
68 | * @return string The module's class name |
||
69 | */ |
||
70 | public function getType() |
||
74 | |||
75 | /** |
||
76 | * Array with the module params to use. |
||
77 | * |
||
78 | * @return array |
||
79 | */ |
||
80 | public function getParams() |
||
84 | |||
85 | /** |
||
86 | * Returns the param with the passed name casted to the specified type. |
||
87 | * |
||
88 | * @param string $name The name of the param to be returned |
||
89 | * |
||
90 | * @return mixed The requested param casted to the specified type |
||
91 | */ |
||
92 | public function getParam($name) |
||
98 | |||
99 | /** |
||
100 | * Prepares the modules array based on a simple xml element node |
||
101 | * |
||
102 | * @param \SimpleXMLElement $node The xml node |
||
103 | * |
||
104 | * @return array |
||
105 | */ |
||
106 | protected function prepareParams(\SimpleXMLElement $node) |
||
123 | } |
||
124 |