| Total Complexity | 2 |
| Total Lines | 45 |
| Duplicated Lines | 0 % |
| Changes | 0 | ||
| 1 | <?php |
||
| 7 | class ProductBulkLoader extends BulkLoader |
||
| 8 | { |
||
| 9 | /** |
||
| 10 | * The default behaviour for creating relations |
||
| 11 | * @var boolean |
||
| 12 | */ |
||
| 13 | protected $relationCreateDefault = false; |
||
| 14 | |||
| 15 | /** |
||
| 16 | * Specify a colsure to be run on every imported record. |
||
| 17 | */ |
||
| 18 | public $recordCallback = 'setOtherProperties'; |
||
| 19 | |||
| 20 | /** |
||
| 21 | * Column Map |
||
| 22 | * @var array |
||
| 23 | */ |
||
| 24 | public $columnMap = [ |
||
| 25 | 'Guid' => 'Guid', |
||
| 26 | 'ProductCode' => 'InternalItemID', |
||
| 27 | 'ProductDescription' => 'Title', |
||
| 28 | 'ProductGroup' => 'Parent', |
||
| 29 | 'DefaultSellPrice' => 'BasePrice', |
||
| 30 | 'Width' => 'Width', |
||
| 31 | 'Height' => 'Height', |
||
| 32 | 'Depth' => 'Depth' |
||
| 33 | ]; |
||
| 34 | |||
| 35 | /** |
||
| 36 | * Keys that need to be unique |
||
| 37 | * @var array |
||
| 38 | */ |
||
| 39 | public $duplicateChecks = [ |
||
| 40 | 'Guid', 'InternalItemID' |
||
| 41 | ]; |
||
| 42 | |||
| 43 | /** |
||
| 44 | * Specify a colsure to be run on every imported record to set other records |
||
| 45 | * @param object $obj The placeholder |
||
| 46 | * @param array $record A row from the external API |
||
| 47 | */ |
||
| 48 | public function setOtherProperties(&$obj, $record) |
||
| 55 |