| Total Complexity | 6 |
| Total Lines | 79 |
| Duplicated Lines | 0 % |
| Coverage | 100% |
| Changes | 0 | ||
| 1 | <?php |
||
| 8 | class Warranty extends ProductDoc implements PermissionProvider |
||
| 9 | { |
||
| 10 | /** |
||
| 11 | * @var string |
||
| 12 | */ |
||
| 13 | private static $singular_name = 'Warranty'; |
||
|
|
|||
| 14 | |||
| 15 | /** |
||
| 16 | * @var string |
||
| 17 | */ |
||
| 18 | private static $plural_name = 'Warranties'; |
||
| 19 | |||
| 20 | /** |
||
| 21 | * @var string |
||
| 22 | */ |
||
| 23 | private static $table_name = 'Warranty'; |
||
| 24 | |||
| 25 | /** |
||
| 26 | * @return FieldList |
||
| 27 | */ |
||
| 28 | 1 | public function getCMSFields() |
|
| 29 | { |
||
| 30 | 1 | $fields = parent::getCMSFields(); |
|
| 31 | |||
| 32 | 1 | $fields->dataFieldByName('Download')->setFolderName('Uploads/Products/Warranties'); |
|
| 33 | |||
| 34 | 1 | return $fields; |
|
| 35 | } |
||
| 36 | |||
| 37 | /** |
||
| 38 | * @return array |
||
| 39 | */ |
||
| 40 | 1 | public function providePermissions() |
|
| 46 | ); |
||
| 47 | } |
||
| 48 | |||
| 49 | /** |
||
| 50 | * @param null $member |
||
| 51 | * |
||
| 52 | * @return bool|int |
||
| 53 | */ |
||
| 54 | 1 | public function canCreate($member = null, $context = []) |
|
| 55 | { |
||
| 56 | 1 | return Permission::check('Warranty_CREATE', 'any', $member); |
|
| 57 | } |
||
| 58 | |||
| 59 | /** |
||
| 60 | * @param null $member |
||
| 61 | * |
||
| 62 | * @return bool|int |
||
| 63 | */ |
||
| 64 | 1 | public function canEdit($member = null, $context = []) |
|
| 65 | { |
||
| 66 | 1 | return Permission::check('Warranty_EDIT', 'any', $member); |
|
| 67 | } |
||
| 68 | |||
| 69 | /** |
||
| 70 | * @param null $member |
||
| 71 | * |
||
| 72 | * @return bool|int |
||
| 73 | */ |
||
| 74 | 1 | public function canDelete($member = null, $context = []) |
|
| 77 | } |
||
| 78 | |||
| 79 | /** |
||
| 80 | * @param null $member |
||
| 81 | * |
||
| 82 | * @return bool |
||
| 83 | */ |
||
| 84 | 11 | public function canView($member = null, $context = []) |
|
| 87 | } |
||
| 88 | } |
||
| 89 |