File tree 1 file changed +9
-2
lines changed 1 file changed +9
-2
lines changed Original file line number Diff line number Diff line change @@ -12,16 +12,19 @@ class DocFile
12
12
{
13
13
private string $ title ;
14
14
private string $ path ;
15
+ private string $ id ;
15
16
16
17
/**
17
18
* @param string $title
18
19
* @param string $path
20
+ * @param string $id
19
21
* @throws FileHelper_Exception
20
22
*/
21
- public function __construct (string $ title , string $ path)
23
+ public function __construct (string $ title , string $ path, string $ id = '' )
22
24
{
23
25
$ this ->title = $ title ;
24
26
$ this ->path = FileHelper::requireFileExists ($ path );
27
+ $ this ->id = $ id ;
25
28
}
26
29
27
30
/**
@@ -34,7 +37,11 @@ public function getPath(): string
34
37
35
38
public function getID () : string
36
39
{
37
- return ConvertHelper::string2shortHash ($ this ->path );
40
+ if (empty ($ this ->id )) {
41
+ $ this ->id = ConvertHelper::string2shortHash ($ this ->path );
42
+ }
43
+
44
+ return $ this ->id ;
38
45
}
39
46
40
47
/**
You can’t perform that action at this time.
0 commit comments