1 | <?php |
||
3 | class TwitterAdmin extends ModelAdmin |
||
|
|||
4 | { |
||
5 | public static $dependencies = [ |
||
6 | 'twitterService' => '%$TwitterService', |
||
7 | ]; |
||
8 | |||
9 | /** |
||
10 | * @var TwitterService |
||
11 | */ |
||
12 | public $twitterService; |
||
13 | |||
14 | /** |
||
15 | * @var string |
||
16 | */ |
||
17 | private static $url_segment = 'twitter'; |
||
18 | |||
19 | /** |
||
20 | * @var string |
||
21 | */ |
||
22 | private static $menu_icon = 'silverstripe-twitter/images/twitter-logo.png'; |
||
23 | |||
24 | /** |
||
25 | * @var string |
||
26 | */ |
||
27 | private static $menu_title = 'Twitter'; |
||
28 | |||
29 | /** |
||
30 | * @var array |
||
31 | */ |
||
32 | private static $managed_models = [ |
||
33 | 'TwitterAccount', |
||
34 | ]; |
||
35 | |||
36 | /** |
||
37 | * @var array |
||
38 | */ |
||
39 | private static $allowed_actions = [ |
||
40 | 'ImportForm', |
||
41 | 'SearchForm', |
||
42 | 'OAuth', |
||
43 | ]; |
||
44 | |||
45 | /** |
||
46 | * @param int $id |
||
47 | * |
||
48 | * @param FieldList $fields |
||
49 | * |
||
50 | * @return Form |
||
51 | */ |
||
52 | public function getEditForm($id = null, $fields = null) |
||
70 | |||
71 | /** |
||
72 | * Handles failed OAuth attempts. |
||
73 | * |
||
74 | * @param string $url |
||
75 | * |
||
76 | * @param Form $form |
||
77 | * |
||
78 | * @return Controller |
||
79 | */ |
||
80 | public function handleOAuthError($url, $form, $message = null) |
||
93 | |||
94 | /** |
||
95 | * OAuth callback handler. |
||
96 | * |
||
97 | * @param SS_HTTPRequest $request |
||
98 | */ |
||
99 | public function OAuth($request) |
||
148 | } |
||
149 | |||
176 |
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.