Conditions | 4 |
Paths | 3 |
Total Lines | 21 |
Code Lines | 13 |
Lines | 0 |
Ratio | 0 % |
Changes | 0 |
1 | <?php |
||
34 | public function getAllTagsMap() |
||
35 | { |
||
36 | $tags = TaxonomyTerm::get()->filter( |
||
37 | 'Type.Name:ExactMatch', |
||
38 | Config::inst()->get('DMSTaxonomyTypeExtension', 'default_record_name') |
||
39 | ); |
||
40 | |||
41 | $map = array(); |
||
42 | foreach ($tags as $tag) { |
||
43 | $nameParts = array($tag->Name); |
||
44 | $currentTag = $tag; |
||
45 | |||
46 | while ($currentTag->Parent() && $currentTag->Parent()->exists()) { |
||
47 | array_unshift($nameParts, $currentTag->Parent()->Name); |
||
48 | $currentTag = $currentTag->Parent(); |
||
49 | } |
||
50 | |||
51 | $map[$tag->ID] = implode(' > ', $nameParts); |
||
52 | } |
||
53 | return $map; |
||
54 | } |
||
55 | } |
||
56 |
You can fix this by adding a namespace to your class:
When choosing a vendor namespace, try to pick something that is not too generic to avoid conflicts with other libraries.