Source of file ProductBrandDecorator.php
Size: 0,616 Bytes - Last Modified: 2021-12-23T10:40:33+00:00
/var/www/docs.ssmods.com/process/src/code/ProductBrandDecorator.php
12345678910111213141516171819202122232425 | <?php class ProductBrandDecorator extends DataObjectDecorator { public function extraStatics() { return array( 'db' => array( ), 'has_one' => array( 'Brand' => 'ProductBrand' ) ); } public function updateCMSFields(&$fields) { if ($brands = DataObject::get('ProductBrand')) { $fields->addFieldToTab('Root.Content.Main', $ddf = new DropDownField('BrandID', 'Brand', $brands->toDropDownMap()), 'FeaturedProduct'); $ddf->setHasEmptyDefault(true); } } } |