1 | <?php |
||
24 | class InstagramPost extends DataObject |
||
25 | { |
||
26 | private static $db = [ |
||
|
|||
27 | 'Show' => 'Boolean', |
||
28 | 'InstagramID' => 'Varchar(100)', |
||
29 | 'ShortCode' => 'Varchar(100)', |
||
30 | 'Handle' => 'Varchar(100)', |
||
31 | 'Caption' => 'Text', |
||
32 | 'Link' => 'Text', |
||
33 | 'Type' => 'Varchar(100)', |
||
34 | 'ImageLowResolutionUrl' => 'Text', |
||
35 | 'ImageStandardResolutionUrl' => 'Text', |
||
36 | 'ImageHighResolutionUrl' => 'Text', |
||
37 | 'ImageThumbnailURL' => 'Text', |
||
38 | 'Posted' => 'Datetime', |
||
39 | 'LikesCount' => 'Int', |
||
40 | 'CommentsCount' => 'Int', |
||
41 | ]; |
||
42 | |||
43 | private static $defaults = [ |
||
44 | 'Show' => true, |
||
45 | ]; |
||
46 | |||
47 | private static $singular_name = 'Instagram Post'; |
||
48 | private static $plural_name = 'Instagram Posts'; |
||
49 | private static $default_sort = 'Posted DESC'; |
||
50 | private static $table_name = 'InstagramPost'; |
||
51 | |||
52 | private static $summary_fields = [ |
||
53 | 'ImageThumbnailURL', |
||
54 | 'Handle', |
||
55 | 'Caption.Summary', |
||
56 | 'Posted', |
||
57 | 'Show.Nice', |
||
58 | ]; |
||
59 | |||
60 | private static $field_labels = [ |
||
61 | 'ImageThumbnailURL' => 'Image', |
||
62 | 'Caption.Summary' => 'Caption', |
||
63 | 'Show.Nice' => 'Show', |
||
64 | ]; |
||
65 | |||
66 | public function getCMSFields() |
||
88 | } |
||
89 |