Source of file ProductBulkLoader.php
Size: 1,259 Bytes - Last Modified: 2022-02-21T10:01:51+00:00
/var/www/docs.ssmods.com/process/src/src/BulkLoader/ProductBulkLoader.php
12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455 | <?php namespace AntonyThorpe\SilverShopUnleashed\BulkLoader; use AntonyThorpe\Consumer\BulkLoader; class ProductBulkLoader extends BulkLoader { /** * The default behaviour for creating relations * @var boolean */ protected $relationCreateDefault = false; /** * Specify a colsure to be run on every imported record. */ public $recordCallback = 'setOtherProperties'; /** * Column Map * @var array */ public $columnMap = [ 'Guid' => 'Guid', 'ProductCode' => 'InternalItemID', 'ProductDescription' => 'Title', 'ProductGroup' => 'Parent', 'DefaultSellPrice' => 'BasePrice', 'Width' => 'Width', 'Height' => 'Height', 'Depth' => 'Depth' ]; /** * Keys that need to be unique * @var array */ public $duplicateChecks = [ 'Guid', 'InternalItemID' ]; /** * Specify a colsure to be run on every imported record to set other records * @param object $obj The placeholder * @param array $record A row from the external API */ public function setOtherProperties(&$obj, $record) { if ($record['Obsolete']) { $obj->AllowPurchase = 0; } } } |