1 | <?php |
||
5 | class FacebookCredentials extends Page |
||
|
|||
6 | { |
||
7 | public static $db = array( |
||
8 | 'BulkTitle' => 'Varchar', |
||
9 | 'BulkCaption' => 'Varchar', |
||
10 | 'BulkCopyright' => 'Varchar', |
||
11 | 'BulkLicense' => 'Varchar', |
||
12 | 'FacebookAlbumID' => 'Varchar', |
||
13 | ); |
||
14 | |||
15 | // facebook information |
||
16 | |||
17 | // the id of the facebook application |
||
18 | protected static $facebook_application_id = null; |
||
19 | |||
20 | // the secret of the facebook application |
||
21 | protected static $facebook_application_secret = null; |
||
22 | |||
23 | // user id to search |
||
24 | protected static $facebook_user_id = null; |
||
25 | |||
26 | public static $has_many = array( |
||
27 | 'AttachedFiles' => 'ImageFile', |
||
28 | ); |
||
29 | |||
30 | public static $has_one = array( |
||
31 | 'CoverPhoto' => 'Image', |
||
32 | ); |
||
33 | |||
34 | //Uncle Cheese hack from http://silverstripe.org/data-model-questions/show/6805 << to detect multiple calls to on after write or on before write |
||
35 | public static $has_written = false; |
||
36 | |||
37 | public function CanUseFacebook() |
||
45 | |||
46 | public static function setFacebookApplicationID($new_app_id) |
||
50 | |||
51 | public static function setFacebookApplicationSecret($new_sec) |
||
55 | |||
56 | public static function setFacebookUserID($new_user_id) |
||
60 | |||
61 | public static function getFacebookApplicationID() |
||
67 | |||
68 | public static function getFacebookApplicationSecret() |
||
72 | |||
73 | public static function getFacebookUserID() |
||
79 | } |
||
80 |
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.