File tree Expand file tree Collapse file tree 1 file changed +24
-1
lines changed Expand file tree Collapse file tree 1 file changed +24
-1
lines changed Original file line number Diff line number Diff line change 20
20
*/
21
21
class Parser
22
22
{
23
+ private $ _default_lang = '' ;
24
+
25
+ public function __construct (string $ default_lang = 'en ' )
26
+ {
27
+ $ this ->setDefaultLanguage ($ default_lang );
28
+ }
29
+
30
+ /**
31
+ * set default language
32
+ */
33
+ public function setDefaultLanguage (string $ default_lang )
34
+ {
35
+ $ this ->_default_lang = $ default_lang ;
36
+ }
37
+
38
+ /**
39
+ * return default language
40
+ */
41
+ public function getDefaultLanguage ()
42
+ {
43
+ return $ this ->_default_lang ;
44
+ }
45
+
23
46
/**
24
47
* creates a feed parser, and xml document, feeds the document to the parser, and returns
25
48
* the result from the parser
@@ -72,7 +95,7 @@ public function parseFromFile(string $filename)
72
95
* Parses feed from the given xml string
73
96
*
74
97
*@param string $xml - the xml string
75
- */
98
+ */
76
99
public function parseFromString (string $ xml )
77
100
{
78
101
return $ this ->parse ($ xml );
You can’t perform that action at this time.
0 commit comments