Source of file BrandsPage.php
Size: 0,859 Bytes - Last Modified: 2021-12-23T10:40:33+00:00
/var/www/docs.ssmods.com/process/src/code/BrandsPage.php
12345678910111213141516171819202122232425262728293031323334353637 | <?php /** * This pagetype lists all the brands that have been set up, using their logo if they have one. */ class BrandsPage extends Page { public static $has_one = array( 'ProductGroup' => 'ProductGroup' ); //TODO: automatically set the product group public function getCMSFields() { $fields = parent::getCMSFields(); if ($source = DataObject::get('ProductGroup')) { $fields->addFieldToTab('Root.Content.Main', new DropdownField('ProductGroupID', 'Main Product Group', $source->toDropDownMap())); } return $fields; } } class BrandsPage_Controller extends Page_Controller { public function Brands() { //TODO: make sure brand has products (and logo?) return DataObject::get('ProductBrand'); } } |