1 | <?php |
||
14 | class BySubpageLinksFinder { |
||
15 | |||
16 | /** |
||
17 | * @var boolean |
||
18 | */ |
||
19 | private $isDiscoveryFallback = true; |
||
20 | |||
21 | /** |
||
22 | * @var array |
||
23 | */ |
||
24 | private $antecedentHierarchyLinks = []; |
||
25 | |||
26 | /** |
||
27 | * @since 1.0 |
||
28 | * |
||
29 | * @param boolean $isDiscoveryFallback |
||
30 | */ |
||
31 | 11 | public function setSubpageDiscoveryFallback( $isDiscoveryFallback ) { |
|
34 | |||
35 | /** |
||
36 | * @since 1.0 |
||
37 | * |
||
38 | * @return boolean |
||
39 | */ |
||
40 | 1 | public function isDiscoveryFallback() { |
|
43 | |||
44 | /** |
||
45 | * @since 1.0 |
||
46 | * |
||
47 | * @param DIWikiPage $subject |
||
48 | */ |
||
49 | 10 | public function findLinksBySubject( DIWikiPage $subject ) { |
|
50 | |||
51 | 10 | $title = $subject->getTitle(); |
|
52 | |||
53 | // Use the text instead of the prefixedText to avoid a split |
||
54 | // in cases where the NS contains a / (e.g. smw/schema:Foobar) |
||
55 | 10 | $text = $title->getText(); |
|
56 | |||
57 | 10 | if ( !$this->canBuildLinksFromText( $text ) ) { |
|
58 | 1 | return; |
|
59 | } |
||
60 | |||
61 | 9 | $this->buildHierarchicalLinksFromText( $text, $title->getNamespace() ); |
|
62 | 9 | } |
|
63 | |||
64 | /** |
||
65 | * @since 1.0 |
||
66 | * |
||
67 | * @return array |
||
68 | */ |
||
69 | 10 | public function getParents() { |
|
72 | |||
73 | 10 | private function canBuildLinksFromText( $text ) { |
|
76 | |||
77 | 9 | private function buildHierarchicalLinksFromText( $text, $ns ) { |
|
95 | |||
96 | } |
||
97 |