Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- class ProductCsvBulkLoader extends CsvBulkLoader {
- public $columnMap = array(
- 'ID' => 'ID',
- 'Name' => 'Name',
- 'PriceExVatDec' => 'PriceExVatDec',
- 'CostPriceDec' => 'CostPriceDec'
- );
- }
- Class Product extends DataObject
- {
- private static $db = array(
- 'Name' => 'Varchar(255)',
- 'URLSegment' => 'Varchar(255)',
- 'ProductCode' => 'Varchar',
- 'CostPrice' => 'Int',
- 'CostPriceDec' => 'Float',
- 'PriceExVat' => 'Int',
- 'PriceExVatDec' => 'Float',
- public function onAfterWrite(){
- parent::onBeforeWrite();
- $this->PriceExVat = ($this->PriceExVatDec * 100);
- $this->CostPrice = ($this->CostPriceDec * 100);
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement