1 | <?php |
||
11 | class Name |
||
12 | { |
||
13 | const NAMESPACE_DELIMITER = '::'; |
||
14 | |||
15 | /** |
||
16 | * Hint path delimiter value. |
||
17 | * |
||
18 | * @var string |
||
19 | */ |
||
20 | const HINT_PATH_DELIMITER = '::'; |
||
21 | |||
22 | /** |
||
23 | * Instance of the template engine. |
||
24 | * @var Engine |
||
25 | */ |
||
26 | protected $engine; |
||
27 | |||
28 | /** |
||
29 | * The original name. |
||
30 | * @var string |
||
31 | */ |
||
32 | protected $name; |
||
33 | |||
34 | /** |
||
35 | * The parsed namespace |
||
36 | */ |
||
37 | protected $namespace; |
||
38 | |||
39 | protected $folder; |
||
40 | |||
41 | /** |
||
42 | 100 | * The parsed template path. |
|
43 | * @var string |
||
44 | 100 | */ |
|
45 | 100 | protected $path; |
|
46 | 94 | ||
47 | /** |
||
48 | * Create a new Name instance. |
||
49 | * @param Engine $engine |
||
50 | * @param string $name |
||
51 | */ |
||
52 | public function __construct(Engine $engine, $name) |
||
57 | 100 | ||
58 | /** |
||
59 | * Set the engine. |
||
60 | * @param Engine $engine |
||
61 | * @return Name |
||
62 | */ |
||
63 | public function setEngine(Engine $engine) |
||
69 | |||
70 | /** |
||
71 | * Get the engine. |
||
72 | * @return Engine |
||
73 | */ |
||
74 | 100 | public function getEngine() |
|
78 | 100 | ||
79 | /** |
||
80 | 100 | * Set the original name and parse it. |
|
81 | 88 | * @param string $name |
|
82 | 98 | * @return Name |
|
83 | 10 | */ |
|
84 | 10 | public function setName($name) |
|
104 | |||
105 | /** |
||
106 | * Get the original name. |
||
107 | * @return string |
||
108 | */ |
||
109 | 10 | public function getName() |
|
113 | 10 | ||
114 | /** |
||
115 | * Set the parsed template folder. |
||
116 | * @param string $namespace |
||
117 | * @return Name |
||
118 | */ |
||
119 | public function setNamespace($namespace) |
||
125 | |||
126 | /** |
||
127 | * Get the parsed template folder. |
||
128 | * @return string |
||
129 | */ |
||
130 | 98 | public function getNamespace() |
|
134 | 4 | ||
135 | /** |
||
136 | 4 | * @deprecated |
|
137 | */ |
||
138 | public function getFolder() |
||
145 | 94 | ||
146 | /** |
||
147 | * Set the parsed template file. |
||
148 | * @param string $path |
||
149 | * @return Name |
||
150 | */ |
||
151 | public function setPath($path) |
||
164 | 68 | ||
165 | public function getFile() |
||
173 | 4 | ||
174 | /** |
||
175 | * Resolve template path or |
||
176 | * Get the parsed template file. |
||
177 | * @return string |
||
178 | */ |
||
179 | public function getPath($resolve = true ) |
||
186 | |||
187 | /** |
||
188 | * Check if template path exists. |
||
189 | 70 | * @return boolean |
|
190 | */ |
||
191 | 70 | public function doesPathExist() |
|
195 | } |
||
196 |