1 | <?php |
||
3 | class TwitterAccount extends DataObject |
||
|
|||
4 | { |
||
5 | public static $dependencies = [ |
||
6 | 'twitterService' => '%$TwitterService', |
||
7 | ]; |
||
8 | |||
9 | /** |
||
10 | * @var TwitterService |
||
11 | */ |
||
12 | public $twitterService; |
||
13 | |||
14 | /** |
||
15 | * @var array |
||
16 | */ |
||
17 | private static $db = [ |
||
18 | 'Title' => 'Varchar', |
||
19 | 'AccessToken' => 'Text', |
||
20 | ]; |
||
21 | |||
22 | /** |
||
23 | * @return FieldList |
||
24 | */ |
||
25 | public function getCMSFields() |
||
67 | |||
68 | /** |
||
69 | * @return FieldList |
||
70 | */ |
||
71 | public function getCMSActions() |
||
98 | |||
99 | /** |
||
100 | * @return RequiredFields |
||
101 | */ |
||
102 | public function getCMSValidator() |
||
106 | |||
107 | /** |
||
108 | * Sets an OAuth token for the TwitterAccount. |
||
109 | * |
||
110 | * @param array $token |
||
111 | */ |
||
112 | 1 | public function setAccessToken($token) |
|
116 | |||
117 | /** |
||
118 | * Gets the TwitterAccount's OAuth token. |
||
119 | * |
||
120 | * @return array |
||
121 | */ |
||
122 | 1 | public function getAccessToken() |
|
126 | |||
127 | /** |
||
128 | * Checks if the TwitterAccount has been authorised via OAuth. |
||
129 | * |
||
130 | * @return boolean |
||
131 | */ |
||
132 | 1 | public function isAuthorised() |
|
136 | } |
||
137 |
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.