Version: current

     1 <?php
     2
     3 class BaseObjectDecorator extends DataObjectDecorator{
     4
     5     function extraStatics() {
     6         return array(
     7             'db' => array(
     8                 'ImportID' => 'Int',
     9                 'agentName' => 'Varchar(100)',
    10                 'agentPhone' => 'Varchar(100)',
    11                 'agentCategory' => "Enum('unspecified, agency, owner, developer')",
    12             )
    13         );
    14     }
    15
    16     function updateCMSFields(& $fields){
    17         $fields->addFieldToTab('Root.Content.Main', new TextField('agentName', 'Имя продавца'),'Image');
    18         $fields->addFieldToTab('Root.Content.Main', new TextField('agentPhone', 'Телефон'),'Image');
    19         $fields->addFieldToTab('Root.Content.Main', new DropdownField('agentCategory', 'Тип продавца', BaseObjectCategory::getAgentCategory(), $this->agentCategory), 'Image');
    20
    21
    22     }
    23
    24 }

[Raise a SilverStripe Framework issue/bug](https://github.com/silverstripe/silverstripe-framework/issues/new)
- [Raise a SilverStripe CMS issue/bug](https://github.com/silverstripe/silverstripe-cms/issues/new)
- Please use the Silverstripe Forums to ask development related questions. -