1 | <?php |
||
20 | class Base |
||
21 | extends \Aimeos\Controller\Jobs\Base |
||
|
|||
22 | { |
||
23 | /** |
||
24 | * Returns the coupon code items for the given codes |
||
25 | * |
||
26 | * @param array $codes List of coupon codes |
||
27 | * @return array Associative list of coupon codes as key and coupon code items as value |
||
28 | */ |
||
29 | protected function getCouponCodeItems( array $codes ) |
||
44 | |||
45 | |||
46 | /** |
||
47 | * Returns the rows from the CSV file up to the maximum count |
||
48 | * |
||
49 | * @param \Aimeos\MW\Container\Content\Iface $content CSV content object |
||
50 | * @param integer $maxcnt Maximum number of rows that should be retrieved at once |
||
51 | * @param integer $codePos Column position which contains the unique coupon code (starting from 0) |
||
52 | * @return array List of arrays with coupon codes as keys and list of values from the CSV file |
||
53 | */ |
||
54 | protected function getData( \Aimeos\MW\Container\Content\Iface $content, $maxcnt, $codePos ) |
||
68 | |||
69 | |||
70 | /** |
||
71 | * Returns the default mapping for the CSV fields to the domain item keys |
||
72 | * |
||
73 | * Example: |
||
74 | * 'item' => array( |
||
75 | * 0 => 'coupon.code.code', // e.g. letters and digits |
||
76 | * 1 => 'coupon.code.count', // number of time the code is available |
||
77 | * ), |
||
78 | * |
||
79 | * @return array Associative list of domains as keys and a list of positions and the domain item keys as values |
||
80 | */ |
||
81 | protected function getDefaultMapping() |
||
92 | |||
93 | |||
94 | /** |
||
95 | * Returns the mapped data from the CSV line |
||
96 | * |
||
97 | * @param array $data List of CSV fields with position as key and domain item key as value (mapped data is removed) |
||
98 | * @param array $mapping List of domain item keys with the CSV field position as key |
||
99 | * @return array List of associative arrays containing the chunked properties |
||
100 | */ |
||
101 | protected function getMappedChunk( array &$data, array $mapping ) |
||
121 | |||
122 | |||
123 | /** |
||
124 | * Returns the processor object for saving the coupon related information |
||
125 | * |
||
126 | * @param array $mappings Associative list of processor types as keys and index/data mappings as values |
||
127 | * @return \Aimeos\Controller\Common\Coupon\Import\Csv\Processor\Iface Processor object |
||
128 | */ |
||
129 | protected function getProcessors( array $mappings ) |
||
167 | } |
||
168 |