Conditions | 3 |
Paths | 4 |
Total Lines | 26 |
Code Lines | 18 |
Lines | 22 |
Ratio | 84.62 % |
Changes | 0 |
1 | <?php |
||
39 | public function updateCMSFields(FieldList $fields) |
||
40 | { |
||
41 | View Code Duplication | if (Config::inst()->get("BlogPostSharedCategoriesExtension", "categories_checkboxes") == true) { |
|
42 | $fields->replaceField( |
||
43 | "Categories", |
||
44 | CheckboxSetField::create( |
||
45 | 'Categories', |
||
46 | _t('BlogPost.Categories', 'Categories'), |
||
47 | BlogCategory::get()->sort(array('Title'=>'ASC'))->map("ID", "Title"), |
||
48 | $this->owner->Categories() |
||
49 | ) |
||
50 | ); |
||
51 | } |
||
52 | View Code Duplication | if (Config::inst()->get("BlogPostSharedCategoriesExtension", "tags_checkboxes") == true) { |
|
53 | $fields->replaceField( |
||
54 | "Tags", |
||
55 | CheckboxSetField::create( |
||
56 | 'Tags', |
||
57 | _t('BlogPost.Tags', 'Tags'), |
||
58 | BlogTag::get()->sort(array('Title'=>'ASC'))->map("ID", "Title"), |
||
59 | $this->owner->Tags() |
||
60 | ) |
||
61 | ); |
||
62 | } |
||
63 | return $fields; |
||
64 | } |
||
65 | } |
||
66 |
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.