| Total Complexity | 5 |
| Total Lines | 81 |
| Duplicated Lines | 0 % |
| Changes | 2 | ||
| Bugs | 0 | Features | 0 |
| 1 | <?php |
||
| 19 | class RecipeDirection extends DataObject |
||
| 20 | { |
||
| 21 | /** |
||
| 22 | * @var array |
||
| 23 | */ |
||
| 24 | private static $db = [ |
||
|
|
|||
| 25 | 'Title' => 'HTMLText', |
||
| 26 | 'Sort' => 'Int', |
||
| 27 | ]; |
||
| 28 | |||
| 29 | /** |
||
| 30 | * @var array |
||
| 31 | */ |
||
| 32 | private static $has_one = [ |
||
| 33 | 'Recipe' => RecipePage::class, |
||
| 34 | ]; |
||
| 35 | |||
| 36 | /** |
||
| 37 | * @var string |
||
| 38 | */ |
||
| 39 | private static $default_sort = 'Sort'; |
||
| 40 | |||
| 41 | /** |
||
| 42 | * @var string |
||
| 43 | */ |
||
| 44 | private static $table_name = 'RecipeDirection'; |
||
| 45 | |||
| 46 | /** |
||
| 47 | * @return FieldList |
||
| 48 | */ |
||
| 49 | public function getCMSFields() |
||
| 63 | } |
||
| 64 | |||
| 65 | /** |
||
| 66 | * @param null $member |
||
| 67 | * @param array $context |
||
| 68 | * @return bool |
||
| 69 | */ |
||
| 70 | public function canCreate($member = null, $context = []) |
||
| 71 | { |
||
| 72 | return true; |
||
| 73 | } |
||
| 74 | |||
| 75 | /** |
||
| 76 | * @param null $member |
||
| 77 | * @return bool |
||
| 78 | */ |
||
| 79 | public function canEdit($member = null) |
||
| 82 | } |
||
| 83 | |||
| 84 | /** |
||
| 85 | * @param null $member |
||
| 86 | * @return bool |
||
| 87 | */ |
||
| 88 | public function canDelete($member = null) |
||
| 89 | { |
||
| 90 | return true; |
||
| 91 | } |
||
| 92 | |||
| 93 | /** |
||
| 94 | * @param null $member |
||
| 95 | * @return bool |
||
| 96 | */ |
||
| 97 | public function canView($member = null) |
||
| 100 | } |
||
| 101 | } |
||
| 102 |