1 | <?php |
||
6 | class RecentBlogPostsBlock extends Block |
||
7 | { |
||
8 | /** |
||
9 | * @var string |
||
10 | */ |
||
11 | private static $singular_name = 'Recent Blog Posts Block'; |
||
12 | |||
13 | /** |
||
14 | * @var string |
||
15 | */ |
||
16 | private static $plural_name = 'Recent Blog Posts Blocks'; |
||
17 | |||
18 | /** |
||
19 | * @var array |
||
20 | */ |
||
21 | private static $db = array( |
||
22 | 'Limit' => 'Int', |
||
23 | ); |
||
24 | |||
25 | /** |
||
26 | * @var array |
||
27 | */ |
||
28 | private static $has_one = array( |
||
29 | 'Blog' => 'Blog', |
||
30 | ); |
||
31 | |||
32 | /** |
||
33 | * @var array |
||
34 | */ |
||
35 | private static $defaults = array( |
||
36 | 'Limit' => 3, |
||
37 | ); |
||
38 | |||
39 | /** |
||
40 | * @return FieldList |
||
41 | */ |
||
42 | 1 | public function getCMSFields() |
|
60 | |||
61 | /** |
||
62 | * @param null $member |
||
63 | * @return bool |
||
64 | */ |
||
65 | 1 | public function canCreate($member = null) |
|
72 | |||
73 | /** |
||
74 | * @param null $member |
||
75 | * @return bool |
||
76 | */ |
||
77 | 1 | public function canView($member = null) |
|
84 | } |