Mark V
1: <?php
2: namespace MOC\V\Core\GlobalsKernel;
3:
4: use MOC\V\Core\GlobalsKernel\Component\Bridge\Repository\UniversalGlobals;
5: use MOC\V\Core\GlobalsKernel\Component\IBridgeInterface;
6: use MOC\V\Core\GlobalsKernel\Component\IVendorInterface;
7:
8: /**
9: * Class GlobalsKernel
10: *
11: * @package MOC\V\Core\GlobalsKernel
12: */
13: class GlobalsKernel implements IVendorInterface
14: {
15:
16: /** @var IVendorInterface $VendorInterface */
17: private $VendorInterface = null;
18:
19: /**
20: * @param IVendorInterface $VendorInterface
21: */
22: public function __construct(IVendorInterface $VendorInterface)
23: {
24:
25: $this->setVendorInterface($VendorInterface);
26: }
27:
28: /**
29: * @return IBridgeInterface
30: */
31: public static function getGlobals()
32: {
33:
34: return self::getUniversalGlobals();
35: }
36:
37: /**
38: * @return IBridgeInterface
39: */
40: private static function getUniversalGlobals()
41: {
42:
43: return new UniversalGlobals();
44: }
45:
46: /**
47: * @return IVendorInterface
48: */
49: public function getVendorInterface()
50: {
51:
52: return $this->VendorInterface;
53: }
54:
55: /**
56: * @param IVendorInterface $VendorInterface
57: *
58: * @return IVendorInterface
59: */
60: public function setVendorInterface(IVendorInterface $VendorInterface)
61: {
62:
63: $this->VendorInterface = $VendorInterface;
64: return $this;
65: }
66:
67: /**
68: * @return IBridgeInterface
69: */
70: public function getBridgeInterface()
71: {
72:
73: return $this->VendorInterface->getBridgeInterface();
74: }
75:
76: /**
77: * @param IBridgeInterface $BridgeInterface
78: *
79: * @return IBridgeInterface
80: */
81: public function setBridgeInterface(IBridgeInterface $BridgeInterface)
82: {
83:
84: return $this->VendorInterface->setBridgeInterface($BridgeInterface);
85: }
86: }
87: