1 | <?php |
||
3 | namespace SunnySideUp\ShareThis; |
||
4 | |||
5 | use SilverStripe\Core\Config\Config; |
||
6 | use SilverStripe\Security\Permission; |
||
7 | use SilverStripe\ORM\DataObject; |
||
8 | |||
9 | /** |
||
10 | * MyTwitterData |
||
11 | */ |
||
12 | class MyTwitterData extends DataObject |
||
13 | { |
||
14 | private static $username = ""; |
||
15 | |||
16 | private static $db = array( |
||
17 | "Date" => "SS_Datetime", |
||
18 | "TwitterID" => "Varchar(64)", |
||
19 | "Title" => "HTMLText", |
||
20 | "Hide" => "Boolean" |
||
21 | ); |
||
22 | |||
23 | private static $summary_fields = array( |
||
24 | "Date" => "Date", |
||
25 | "Title" => "Title", |
||
26 | "HideNice" => "Hide" |
||
27 | ); |
||
28 | |||
29 | private static $indexes = array( |
||
30 | "TwitterID" => true |
||
31 | ); |
||
32 | |||
33 | private static $casting = array( |
||
34 | "Link" => "Varchar", |
||
35 | "HideNice" => "Varchar" |
||
36 | ); |
||
37 | |||
38 | private static $default_sort = "\"Date\" DESC"; |
||
39 | |||
40 | public function forTemplate() |
||
44 | |||
45 | public function Link() |
||
49 | |||
50 | |||
51 | public function canView($member = null) |
||
55 | |||
56 | public function canCreate($member = null, $context = []) |
||
60 | |||
61 | public function canEdit($member = null) |
||
65 | |||
66 | public function canDelete($member = null) |
||
67 | { |
||
76 |
Our type inference engine in quite powerful, but sometimes the code does not provide enough clues to go by. In these cases we request you to add a
@return
annotation as described here.