|
1
|
|
|
<?PHP |
|
2
|
|
|
|
|
3
|
|
|
/** |
|
4
|
|
|
* AppserverIo\Resources\Interfaces\Resources |
|
5
|
|
|
* |
|
6
|
|
|
* NOTICE OF LICENSE |
|
7
|
|
|
* |
|
8
|
|
|
* This source file is subject to the Open Software License (OSL 3.0) |
|
9
|
|
|
* that is available through the world-wide-web at this URL: |
|
10
|
|
|
* http://opensource.org/licenses/osl-3.0.php |
|
11
|
|
|
* |
|
12
|
|
|
* PHP version 5 |
|
13
|
|
|
* |
|
14
|
|
|
* @author Tim Wagner <[email protected]> |
|
15
|
|
|
* @copyright 2018 TechDivision GmbH <[email protected]> |
|
16
|
|
|
* @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) |
|
17
|
|
|
* @link https://github.com/appserver-io/resources |
|
18
|
|
|
* @link http://www.appserver.io |
|
19
|
|
|
*/ |
|
20
|
|
|
|
|
21
|
|
|
namespace AppserverIo\Resources; |
|
22
|
|
|
|
|
23
|
|
|
use AppserverIo\Resources\Interfaces\ResourceBundleInterface; |
|
24
|
|
|
|
|
25
|
|
|
/** |
|
26
|
|
|
* Abstract class of all resource bundles. |
|
27
|
|
|
* |
|
28
|
|
|
* @author Tim Wagner <[email protected]> |
|
29
|
|
|
* @copyright 2018 TechDivision GmbH <[email protected]> |
|
30
|
|
|
* @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) |
|
31
|
|
|
* @link https://github.com/appserver-io/resources |
|
32
|
|
|
* @link http://www.appserver.io |
|
33
|
|
|
*/ |
|
34
|
|
|
abstract class AbstractResourceBundle implements ResourceBundleInterface |
|
35
|
|
|
{ |
|
36
|
|
|
|
|
37
|
|
|
/** |
|
38
|
|
|
* Holds the system locale to use |
|
39
|
|
|
* |
|
40
|
|
|
* @var \AppserverIo\Resources\SystemLocale |
|
41
|
|
|
*/ |
|
42
|
|
|
protected $systemLocale = null; |
|
43
|
|
|
|
|
44
|
|
|
/** |
|
45
|
|
|
* The constructor initializes the Resources with the |
|
46
|
|
|
* system locale to use. |
|
47
|
|
|
* |
|
48
|
|
|
* @param \AppserverIo\Resources\SystemLocale $systemLocale Holds the system locale instance to load the resources for |
|
49
|
|
|
* |
|
50
|
|
|
* @return void |
|
51
|
|
|
*/ |
|
52
|
|
|
protected function __construct(SystemLocale $systemLocale) |
|
53
|
|
|
{ |
|
54
|
|
|
$this->setSystemLocale($systemLocale); |
|
55
|
|
|
} |
|
56
|
|
|
|
|
57
|
|
|
/** |
|
58
|
|
|
* This method returns the system locale instance. |
|
59
|
|
|
* |
|
60
|
|
|
* @return \AppserverIo\Resources\SystemLocale The system locale |
|
61
|
|
|
* @see \AppserverIo\Resources\Interfaces\ResourceBundleInterface::getSystemLocale() |
|
62
|
|
|
*/ |
|
63
|
|
|
public function getSystemLocale() |
|
64
|
|
|
{ |
|
65
|
|
|
return $this->systemLocale; |
|
66
|
|
|
} |
|
67
|
|
|
|
|
68
|
|
|
/** |
|
69
|
|
|
* This sets the passed system locale. |
|
70
|
|
|
* |
|
71
|
|
|
* @param \AppserverIo\Resources\SystemLocale $newLocale The new system locale |
|
72
|
|
|
* |
|
73
|
|
|
* @return void |
|
74
|
|
|
*/ |
|
75
|
|
|
public function setSystemLocale(SystemLocale $newLocale) |
|
76
|
|
|
{ |
|
77
|
|
|
$this->systemLocale = $newLocale; |
|
78
|
|
|
} |
|
79
|
|
|
} |
|
80
|
|
|
|