Advertisement
Guest User

Untitled

a guest
Nov 10th, 2015
102
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.82 KB | None | 0 0
  1. <?php
  2. class ProductCsvBulkLoader extends CsvBulkLoader {
  3. public $columnMap = array(
  4. 'ID' => 'ID',
  5. 'Name' => 'Name',
  6. 'PriceExVatDec' => 'PriceExVatDec',
  7. 'CostPriceDec' => 'CostPriceDec'
  8. );
  9.  
  10.  
  11.  
  12.  
  13. }
  14.  
  15.  
  16.  
  17. Class Product extends DataObject
  18. {
  19.  
  20. private static $db = array(
  21. 'Name' => 'Varchar(255)',
  22. 'URLSegment' => 'Varchar(255)',
  23. 'ProductCode' => 'Varchar',
  24. 'CostPrice' => 'Int',
  25. 'CostPriceDec' => 'Float',
  26. 'PriceExVat' => 'Int',
  27. 'PriceExVatDec' => 'Float',
  28.  
  29.  
  30.  
  31. public function onAfterWrite(){
  32. parent::onBeforeWrite();
  33.  
  34. $this->PriceExVat = ($this->PriceExVatDec * 100);
  35. $this->CostPrice = ($this->CostPriceDec * 100);
  36. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement