1 | <?php |
||
49 | abstract class AbstractContext implements ContextInterface |
||
50 | { |
||
51 | /** |
||
52 | * Current default vocabulary |
||
53 | * |
||
54 | * @var VocabularyInterface |
||
55 | */ |
||
56 | protected $defaultVocabulary = null; |
||
57 | |||
58 | /** |
||
59 | * Parent thing |
||
60 | * |
||
61 | * @var ThingInterface |
||
62 | */ |
||
63 | protected $parentThing; |
||
64 | |||
65 | /** |
||
66 | * Root thing |
||
67 | * |
||
68 | * @var RootThing |
||
69 | */ |
||
70 | protected $rootThing; |
||
71 | |||
72 | /** |
||
73 | * Context constructor |
||
74 | */ |
||
75 | 27 | public function __construct() |
|
79 | |||
80 | /** |
||
81 | * Return the registered child things |
||
82 | * |
||
83 | * @return ThingInterface[] Child things |
||
84 | */ |
||
85 | 12 | public function getChildren() |
|
89 | |||
90 | /** |
||
91 | * Return the current parent thing |
||
92 | * |
||
93 | * @return ThingInterface|null Parent thing |
||
94 | */ |
||
95 | 12 | public function getParentThing() |
|
99 | |||
100 | /** |
||
101 | * Set the parent thing |
||
102 | * |
||
103 | * @param ThingInterface $parentThing Parent thing |
||
104 | * @return ContextInterface Self reference |
||
105 | */ |
||
106 | 13 | public function setParentThing(ThingInterface $parentThing) |
|
117 | |||
118 | /** |
||
119 | * Add a child thing to the current parent thing |
||
120 | * |
||
121 | * @param ThingInterface $thing Child thing |
||
122 | * @return ContextInterface Self reference |
||
123 | */ |
||
124 | 12 | public function addChild(ThingInterface $thing) |
|
129 | |||
130 | /** |
||
131 | * Return the current default vocabulary |
||
132 | * |
||
133 | * @return VocabularyInterface Current default vocabulary |
||
134 | */ |
||
135 | 15 | public function getDefaultVocabulary() |
|
139 | } |
||
140 |