1 | <?php |
||
36 | class EeBunchSubject extends BunchSubject |
||
37 | { |
||
38 | |||
39 | /** |
||
40 | * The row ID of the product that has been created recently. |
||
41 | * |
||
42 | * @var integer |
||
43 | */ |
||
44 | protected $lastRowId; |
||
45 | |||
46 | /** |
||
47 | * The mapping for the SKUs to the created row IDs. |
||
48 | * |
||
49 | * @var array |
||
50 | */ |
||
51 | protected $skuRowIdMapping = array(); |
||
52 | |||
53 | /** |
||
54 | * Mappings for the table column => CSV column header. |
||
55 | * |
||
56 | * @var array |
||
57 | */ |
||
58 | protected $headerStockMappings = array( |
||
59 | 'qty' => array('qty', 'float'), |
||
60 | 'min_qty' => array('out_of_stock_qty', 'float'), |
||
61 | 'use_config_min_qty' => array('use_config_min_qty', 'int'), |
||
62 | 'is_qty_decimal' => array('is_qty_decimal', 'int'), |
||
63 | 'backorders' => array('allow_backorders', 'int'), |
||
64 | 'use_config_backorders' => array('use_config_backorders', 'int'), |
||
65 | 'min_sale_qty' => array('min_cart_qty', 'float'), |
||
66 | 'use_config_min_sale_qty' => array('use_config_min_sale_qty', 'int'), |
||
67 | 'max_sale_qty' => array('max_cart_qty', 'float'), |
||
68 | 'use_config_max_sale_qty' => array('use_config_max_sale_qty', 'int'), |
||
69 | 'is_in_stock' => array('is_in_stock', 'int'), |
||
70 | 'notify_stock_qty' => array('notify_on_stock_below', 'float'), |
||
71 | 'use_config_notify_stock_qty' => array('use_config_notify_stock_qty', 'int'), |
||
72 | 'manage_stock' => array('manage_stock', 'int'), |
||
73 | 'use_config_manage_stock' => array('use_config_manage_stock', 'int'), |
||
74 | 'use_config_qty_increments' => array('use_config_qty_increments', 'int'), |
||
75 | 'qty_increments' => array('qty_increments', 'float'), |
||
76 | 'use_config_enable_qty_inc' => array('use_config_enable_qty_inc', 'int'), |
||
77 | 'enable_qty_increments' => array('enable_qty_increments', 'int'), |
||
78 | 'is_decimal_divided' => array('is_decimal_divided', 'int'), |
||
79 | 'deferred_stock_update' => array('deferred_stock_update', 'int'), |
||
80 | 'use_config_deferred_stock_update' => array('use_config_deferred_stock_update', 'int'), |
||
81 | ); |
||
82 | |||
83 | /** |
||
84 | * The default callback mappings for the Magento EE standard product attributes. |
||
85 | * |
||
86 | * @var array |
||
87 | */ |
||
88 | protected $defaultEeCallbackMappings = array( |
||
89 | 'is_returnable' => array('import_product_ee.callback.rma') |
||
90 | ); |
||
91 | |||
92 | /** |
||
93 | * Return's the default callback mappings. |
||
94 | * |
||
95 | * @return array The default callback mappings |
||
96 | */ |
||
97 | public function getDefaultCallbackMappings() |
||
101 | |||
102 | /** |
||
103 | * Clean up the global data after importing the bunch. |
||
104 | * |
||
105 | * @param string $serial The serial of the actual import |
||
106 | * |
||
107 | * @return void |
||
108 | */ |
||
109 | public function tearDown($serial) |
||
121 | |||
122 | /** |
||
123 | * Set's the row ID of the product that has been created recently. |
||
124 | * |
||
125 | * @param string $lastRowId The row ID |
||
126 | * |
||
127 | * @return void |
||
128 | */ |
||
129 | public function setLastRowId($lastRowId) |
||
133 | |||
134 | /** |
||
135 | * Return's the row ID of the product that has been created recently. |
||
136 | * |
||
137 | * @return string The row Id |
||
138 | */ |
||
139 | public function getLastRowId() |
||
143 | |||
144 | /** |
||
145 | * Add the passed SKU => row ID mapping. |
||
146 | * |
||
147 | * @param string $sku The SKU |
||
148 | * @param integer|null $rowId The optional entity ID, the last processed entity ID is used, if not set |
||
149 | * |
||
150 | * @return void |
||
151 | */ |
||
152 | public function addSkuRowIdMapping($sku, $rowId = null) |
||
156 | |||
157 | /** |
||
158 | * Return the row ID for the passed SKU. |
||
159 | * |
||
160 | * @param string $sku The SKU to return the row ID for |
||
161 | * |
||
162 | * @return integer The mapped row ID |
||
163 | * @throws \TechDivision\Import\Product\Ee\Exceptions\MapSkuToRowIdException Is thrown if the SKU is not mapped yet |
||
164 | */ |
||
165 | public function mapSkuToRowId($sku) |
||
180 | } |
||
181 |
This check looks for assignments to scalar types that may be of the wrong type.
To ensure the code behaves as expected, it may be a good idea to add an explicit type cast.