| Total Complexity | 4 |
| Total Lines | 46 |
| Duplicated Lines | 0 % |
| Changes | 2 | ||
| Bugs | 0 | Features | 0 |
| 1 | <?php |
||
| 18 | class CategoryExtension extends DataExtension |
||
| 19 | { |
||
| 20 | private static $has_one = [ |
||
|
|
|||
| 21 | "Image" => Image::class |
||
| 22 | ]; |
||
| 23 | |||
| 24 | private static $owns = [ |
||
| 25 | "Image" |
||
| 26 | ]; |
||
| 27 | |||
| 28 | /** |
||
| 29 | * Gets the main image to use for this category, this |
||
| 30 | * can either be the selected image, an image from the |
||
| 31 | * first product or the default "no-product" image. |
||
| 32 | * |
||
| 33 | * @return Image |
||
| 34 | */ |
||
| 35 | public function PrimaryImage() |
||
| 53 | } |
||
| 54 | |||
| 55 | /** |
||
| 56 | * Add the image upload field to the admin fields. |
||
| 57 | */ |
||
| 58 | public function updateCMSFields(FieldList $fields) |
||
| 66 | } |