Passed
Push — master ( add725...ffb802 )
by Aimeos
04:14
created

Standard::getDescription()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 3
Code Lines 1

Duplication

Lines 0
Ratio 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
cc 1
eloc 1
c 1
b 0
f 0
nc 1
nop 0
dl 0
loc 3
rs 10
1
<?php
2
3
/**
4
 * @license LGPLv3, http://opensource.org/licenses/LGPL-3.0
5
 * @copyright Aimeos (aimeos.org), 2025
6
 * @package Controller
7
 * @subpackage Jobs
8
 */
9
10
11
namespace Aimeos\Controller\Jobs\Customer\Import\Csv;
12
13
14
/**
15
 * Job controller for CSV customer imports.
16
 *
17
 * @package Controller
18
 * @subpackage Jobs
19
 */
20
class Standard
21
	extends \Aimeos\Controller\Jobs\Common\Customer\Import\Csv\Base
22
	implements \Aimeos\Controller\Jobs\Iface
23
{
24
	/** controller/jobs/customer/import/csv/name
25
	 * Class name of the used customer suggestions scheduler controller implementation
26
	 *
27
	 * Each default job controller can be replace by an alternative imlementation.
28
	 * To use this implementation, you have to set the last part of the class
29
	 * name as configuration value so the controller factory knows which class it
30
	 * has to instantiate.
31
	 *
32
	 * For example, if the name of the default class is
33
	 *
34
	 *  \Aimeos\Controller\Jobs\Customer\Import\Csv\Standard
35
	 *
36
	 * and you want to replace it with your own version named
37
	 *
38
	 *  \Aimeos\Controller\Jobs\Customer\Import\Csv\Mycsv
39
	 *
40
	 * then you have to set the this configuration option:
41
	 *
42
	 *  controller/jobs/customer/import/csv/name = Mycsv
43
	 *
44
	 * The value is the last part of your own class name and it's case sensitive,
45
	 * so take care that the configuration value is exactly named like the last
46
	 * part of the class name.
47
	 *
48
	 * The allowed characters of the class name are A-Z, a-z and 0-9. No other
49
	 * characters are possible! You should always start the last part of the class
50
	 * name with an upper case character and continue only with lower case characters
51
	 * or numbers. Avoid chamel case names like "MyCsv"!
52
	 *
53
	 * @param string Last part of the class name
54
	 * @since 2025.10
55
	 */
56
57
	/** controller/jobs/customer/import/csv/decorators/excludes
58
	 * Excludes decorators added by the "common" option from the customer import CSV job controller
59
	 *
60
	 * Decorators extend the functionality of a class by adding new aspects
61
	 * (e.g. log what is currently done), executing the methods of the underlying
62
	 * class only in certain conditions (e.g. only for logged in users) or
63
	 * modify what is returned to the caller.
64
	 *
65
	 * This option allows you to remove a decorator added via
66
	 * "controller/jobs/common/decorators/default" before they are wrapped
67
	 * around the job controller.
68
	 *
69
	 *  controller/jobs/customer/import/csv/decorators/excludes = array( 'decorator1' )
70
	 *
71
	 * This would remove the decorator named "decorator1" from the list of
72
	 * common decorators ("\Aimeos\Controller\Jobs\Common\Decorator\*") added via
73
	 * "controller/jobs/common/decorators/default" to the job controller.
74
	 *
75
	 * @param array List of decorator names
76
	 * @since 2025.10
77
	 * @see controller/jobs/common/decorators/default
78
	 * @see controller/jobs/customer/import/csv/decorators/global
79
	 * @see controller/jobs/customer/import/csv/decorators/local
80
	 */
81
82
	/** controller/jobs/customer/import/csv/decorators/global
83
	 * Adds a list of globally available decorators only to the customer import CSV job controller
84
	 *
85
	 * Decorators extend the functionality of a class by adding new aspects
86
	 * (e.g. log what is currently done), executing the methods of the underlying
87
	 * class only in certain conditions (e.g. only for logged in users) or
88
	 * modify what is returned to the caller.
89
	 *
90
	 * This option allows you to wrap global decorators
91
	 * ("\Aimeos\Controller\Jobs\Common\Decorator\*") around the job controller.
92
	 *
93
	 *  controller/jobs/customer/import/csv/decorators/global = array( 'decorator1' )
94
	 *
95
	 * This would add the decorator named "decorator1" defined by
96
	 * "\Aimeos\Controller\Jobs\Common\Decorator\Decorator1" only to the job controller.
97
	 *
98
	 * @param array List of decorator names
99
	 * @since 2025.10
100
	 * @see controller/jobs/common/decorators/default
101
	 * @see controller/jobs/customer/import/csv/decorators/excludes
102
	 * @see controller/jobs/customer/import/csv/decorators/local
103
	 */
104
105
	/** controller/jobs/customer/import/csv/decorators/local
106
	 * Adds a list of local decorators only to the customer import CSV job controller
107
	 *
108
	 * Decorators extend the functionality of a class by adding new aspects
109
	 * (e.g. log what is currently done), executing the methods of the underlying
110
	 * class only in certain conditions (e.g. only for logged in users) or
111
	 * modify what is returned to the caller.
112
	 *
113
	 * This option allows you to wrap local decorators
114
	 * ("\Aimeos\Controller\Jobs\Customer\Import\Csv\Decorator\*") around the job
115
	 * controller.
116
	 *
117
	 *  controller/jobs/customer/import/csv/decorators/local = array( 'decorator2' )
118
	 *
119
	 * This would add the decorator named "decorator2" defined by
120
	 * "\Aimeos\Controller\Jobs\Customer\Import\Csv\Decorator\Decorator2"
121
	 * only to the job controller.
122
	 *
123
	 * @param array List of decorator names
124
	 * @since 2025.10
125
	 * @see controller/jobs/common/decorators/default
126
	 * @see controller/jobs/customer/import/csv/decorators/excludes
127
	 * @see controller/jobs/customer/import/csv/decorators/global
128
	 */
129
130
131
	private ?array $types = null;
0 ignored issues
show
introduced by
The private property $types is not used, and could be removed.
Loading history...
132
133
134
	/**
135
	 * Returns the localized name of the job.
136
	 *
137
	 * @return string Name of the job
138
	 */
139
	public function getName() : string
140
	{
141
		return $this->context()->translate( 'controller/jobs', 'Customer import CSV' );
142
	}
143
144
145
	/**
146
	 * Returns the localized description of the job.
147
	 *
148
	 * @return string Description of the job
149
	 */
150
	public function getDescription() : string
151
	{
152
		return $this->context()->translate( 'controller/jobs', 'Imports new and updates existing customers from CSV files' );
153
	}
154
155
156
	/**
157
	 * Executes the job.
158
	 *
159
	 * @throws \Aimeos\Controller\Jobs\Exception If an error occurs
160
	 */
161
	public function run()
162
	{
163
		$context = $this->context();
164
		$logger = $context->logger();
165
		$date = date( 'Y-m-d H:i:s' );
166
167
		try
168
		{
169
			$files = $errors = 0;
170
			$fs = $context->fs( 'fs-import' );
171
			$site = $context->locale()->getSiteItem()->getCode();
172
			$location = $this->location() . '/' . $site;
173
174
			if( $fs->isDir( $location ) === false ) {
175
				return;
176
			}
177
178
			$logger->info( sprintf( 'Started customer import from "%1$s"', $location ), 'import/csv/customer' );
179
180
			foreach( map( $fs->scan( $location ) )->sort() as $filename )
181
			{
182
				$path = $location . '/' . $filename;
183
184
				if( $filename[0] === '.' || $fs instanceof \Aimeos\Base\Filesystem\DirIface && $fs->isDir( $path ) ) {
185
					continue;
186
				}
187
188
				$errors = $this->import( $path );
189
				$files++;
190
			}
191
192
			/** controller/jobs/customer/import/csv/cleanup
193
			 * Deletes all customers with categories which havn't been updated
194
			 *
195
			 * By default, the customer importer only adds new and updates existing
196
			 * customers but doesn't delete any customers. If you want to remove all
197
			 * customers which haven't been updated during the import, then set this
198
			 * configuration option to "true". This will remove all customers which
199
			 * are not assigned to any category but keep the ones without categories,
200
			 * e.g. rebate customers.
201
			 *
202
			 * @param bool TRUE to delete all untouched customers, FALSE to keep them
203
			 * @since 2025.10
204
			 * @see controller/jobs/customer/import/csv/backup
205
			 * @see controller/jobs/customer/import/csv/domains
206
			 * @see controller/jobs/customer/import/csv/location
207
			 * @see controller/jobs/customer/import/csv/mapping
208
			 * @see controller/jobs/customer/import/csv/max-size
209
			 * @see controller/jobs/customer/import/csv/skip-lines
210
			 */
211
			if( $files && $context->config()->get( 'controller/jobs/customer/import/csv/cleanup', false ) )
212
			{
213
				$count = $this->cleanup( $date );
214
				$logger->info( sprintf( 'Cleaned %1$s old customers', $count ), 'import/csv/customer' );
215
			}
216
217
			if( $errors > 0 ) {
218
				$this->mail( 'Customer CSV import', sprintf( 'Invalid customer lines during import: %1$d', $errors ) );
219
			}
220
221
			$logger->info( sprintf( 'Finished customer import from "%1$s"', $location ), 'import/csv/customer' );
222
		}
223
		catch( \Exception $e )
224
		{
225
			$logger->error( 'Customer import error: ' . $e->getMessage() . "\n" . $e->getTraceAsString(), 'import/csv/customer' );
226
			$this->mail( 'Customer CSV import error', $e->getMessage() . "\n" . $e->getTraceAsString() );
227
			throw new \Aimeos\Controller\Jobs\Exception( $e->getMessage() );
228
		}
229
	}
230
231
232
	/**
233
	 * Returns the directory for storing imported files
234
	 *
235
	 * @return string Directory for storing imported files
236
	 */
237
	protected function backup() : string
238
	{
239
		/** controller/jobs/customer/import/csv/backup
240
		 * Name of the backup for sucessfully imported files
241
		 *
242
		 * After a CSV file was imported successfully, you can move it to another
243
		 * location, so it won't be imported again and isn't overwritten by the
244
		 * next file that is stored at the same location in the file system.
245
		 *
246
		 * You should use an absolute path to be sure but can be relative path
247
		 * if you absolutely know from where the job will be executed from. The
248
		 * name of the new backup location can contain placeholders understood
249
		 * by the PHP DateTime::format() method (with percent signs prefix) to
250
		 * create dynamic paths, e.g. "backup/%Y-%m-%d" which would create
251
		 * "backup/2000-01-01". For more information about the date() placeholders,
252
		 * please have a look  into the PHP documentation of the
253
		 * {@link https://www.php.net/manual/en/datetime.format.php format() method}.
254
		 *
255
		 * **Note:** If no backup name is configured, the file will be removed!
256
		 *
257
		 * @param integer Name of the backup file, optionally with date/time placeholders
258
		 * @since 2025.10
259
		 * @see controller/jobs/customer/import/csv/cleanup
260
		 * @see controller/jobs/customer/import/csv/domains
261
		 * @see controller/jobs/customer/import/csv/location
262
		 * @see controller/jobs/customer/import/csv/mapping
263
		 * @see controller/jobs/customer/import/csv/max-size
264
		 * @see controller/jobs/customer/import/csv/skip-lines
265
		 */
266
		$backup = $this->context()->config()->get( 'controller/jobs/customer/import/csv/backup' );
267
		return \Aimeos\Base\Str::strtime( (string) $backup );
268
	}
269
270
271
	/**
272
	 * Cleans up the given list of customer items
273
	 *
274
	 * @param \Aimeos\Map $customers List of customer items implementing \Aimeos\MShop\Customer\Item\Iface
275
	 */
276
	protected function clean( \Aimeos\Map $customers )
277
	{
278
		$manager = \Aimeos\MShop::create( $this->context(), 'customer' );
279
280
		$manager->begin();
281
		$manager->save( $customers->setStatus( -2 ) );
282
		$manager->commit();
283
	}
284
285
286
	/**
287
	 * Adds conditions to the filter for fetching customers that should be removed
288
	 *
289
	 * @param \Aimeos\Base\Criteria\Iface $filter Criteria object
290
	 * @return \Aimeos\Base\Criteria\Iface Modified criteria object
291
	 */
292
	protected function cleaner( \Aimeos\Base\Criteria\Iface $filter ) : \Aimeos\Base\Criteria\Iface
293
	{
294
		return $filter;
295
	}
296
297
298
	/**
299
	 * Removes all customers which have been updated before the given date/time
300
	 *
301
	 * @param string $datetime Date and time in ISO format
302
	 * @return int Number of removed customers
303
	 */
304
	protected function cleanup( string $datetime ) : int
305
	{
306
		$count = 0;
307
		$manager = \Aimeos\MShop::create( $this->context(), 'customer' );
308
309
		$filter = $manager->filter();
310
		$filter->add( 'customer.mtime', '<', $datetime );
311
		$cursor = $manager->cursor( $this->call( 'cleaner', $filter ) );
312
313
		while( $items = $manager->iterate( $cursor, ['customer' => ['default']] ) )
314
		{
315
			$this->call( 'clean', $items );
316
			$count += count( $items );
317
		}
318
319
		return $count;
320
	}
321
322
323
	/**
324
	 * Returns the list of domain names that should be retrieved along with the attribute items
325
	 *
326
	 * @return array List of domain names
327
	 */
328
	protected function domains() : array
329
	{
330
		$default = ['customer/address', 'customer/property'];
331
332
		/** controller/jobs/customer/import/csv/domains
333
		 * List of item domain names that should be retrieved along with the customer items
334
		 *
335
		 * For efficient processing, the items associated to the customers can be
336
		 * fetched to, minimizing the number of database queries required. To be
337
		 * most effective, the list of item domain names should be used in the
338
		 * mapping configuration too, so the retrieved items will be used during
339
		 * the import.
340
		 *
341
		 * @param array Associative list of MShop item domain names
342
		 * @since 2025.10
343
		 * @see controller/jobs/customer/import/csv/backup
344
		 * @see controller/jobs/customer/import/csv/cleanup
345
		 * @see controller/jobs/customer/import/csv/location
346
		 * @see controller/jobs/customer/import/csv/mapping
347
		 * @see controller/jobs/customer/import/csv/max-size
348
		 * @see controller/jobs/customer/import/csv/skip-lines
349
		 */
350
		return $this->context()->config()->get( 'controller/jobs/customer/import/csv/domains', $default );
351
	}
352
353
354
	/**
355
	 * Returns the position of the "customer.code" column from the customer item mapping
356
	 *
357
	 * @param array $mapping Mapping of the "item" columns with position as key and code as value
358
	 * @return int Position of the "customer.code" column
359
	 * @throws \Aimeos\Controller\Jobs\Exception If no mapping for "customer.code" is found
360
	 */
361
	protected function getCodePosition( array $mapping ) : int
362
	{
363
		foreach( $mapping as $pos => $key )
364
		{
365
			if( $key === 'customer.code' ) {
366
				return $pos;
367
			}
368
		}
369
370
		throw new \Aimeos\Controller\Jobs\Exception( sprintf( 'No "customer.code" column in CSV mapping found' ) );
371
	}
372
373
374
	/**
375
	 * Returns the customer items for the given codes
376
	 *
377
	 * @param array $codes List of customer codes
378
	 * @param array $domains List of domains whose items should be fetched too
379
	 * @return \Aimeos\Map Associative list of customer codes as key and customer items as value
380
	 */
381
	protected function getCustomers( array $codes, array $domains ) : \Aimeos\Map
382
	{
383
		$manager = \Aimeos\MShop::create( $this->context(), 'customer' );
384
		$search = $manager->filter()->add( ['customer.code' => $codes] )->slice( 0, count( $codes ) );
385
386
		return $manager->search( $search, $domains )->col( null, 'customer.code' );
387
	}
388
389
390
	/**
391
	 * Imports the CSV file from the given path
392
	 *
393
	 * @param string $path Relative path to the CSV file
394
	 * @return int Number of lines which couldn't be imported
395
	 */
396
	protected function import( string $path ) : int
397
	{
398
		$context = $this->context();
399
		$logger = $context->logger();
400
401
		$logger->info( sprintf( 'Started customer import from "%1$s"', $path ), 'import/csv/customer' );
402
403
		$maxcnt = $this->max();
404
		$skiplines = $this->skip();
405
		$domains = $this->domains();
406
407
		$mappings = $this->mapping();
408
		$processor = $this->getProcessors( $mappings );
409
		$codePos = $this->getCodePosition( $mappings['item'] );
410
411
		$fs = $context->fs( 'fs-import' );
412
		$fh = $fs->reads( $path );
413
		$total = $errors = 0;
414
415
		for( $i = 0; $i < $skiplines; $i++ ) {
416
			fgetcsv( $fh, null, ',', '"', '' );
417
		}
418
419
		while( ( $data = $this->getData( $fh, $maxcnt, $codePos ) ) !== [] )
420
		{
421
			$customers = $this->getCustomers( array_keys( $data ), $domains );
422
			$errors += $this->importCustomers( $customers, $data, $mappings['item'], [], $processor );
423
424
			$total += count( $data );
425
			unset( $customers, $data );
426
		}
427
428
		$processor->finish();
429
		fclose( $fh );
430
431
		if( !empty( $backup = $this->backup() ) ) {
432
			$fs->move( $path, $backup );
433
		} else {
434
			$fs->rm( $path );
435
		}
436
437
		$str = sprintf( 'Finished customer import from "%1$s" (%2$d/%3$d)', $path, $errors, $total );
438
		$logger->info( $str, 'import/csv/customer' );
439
440
		return $errors;
441
	}
442
443
444
	/**
445
	 * Imports the CSV data and creates new customers or updates existing ones
446
	 *
447
	 * @param \Aimeos\Map $customers List of customers items implementing \Aimeos\MShop\Customer\Item\Iface
448
	 * @param array $data Associative list of import data as index/value pairs
449
	 * @param array $mapping Associative list of positions and domain item keys
450
	 * @param array $types List of allowed customer type codes
451
	 * @param \Aimeos\Controller\Jobs\Common\Customer\Import\Csv\Processor\Iface $processor Processor object
452
	 * @return int Number of customers that couldn't be imported
453
	 * @throws \Aimeos\Controller\Jobs\Exception
454
	 */
455
	protected function importCustomers( \Aimeos\Map $customers, array $data, array $mapping, array $types,
456
		\Aimeos\Controller\Jobs\Common\Customer\Import\Csv\Processor\Iface $processor ) : int
457
	{
458
		$items = [];
459
		$errors = 0;
460
		$context = $this->context();
461
		$manager = \Aimeos\MShop::create( $context, 'customer' );
462
463
		foreach( $data as $code => $list )
464
		{
465
			$manager->begin();
466
467
			try
468
			{
469
				$code = trim( $code );
470
				$customer = $customers[$code] ?? $manager->create();
471
				$map = current( $this->getMappedChunk( $list, $mapping ) ); // there can only be one chunk for the base customer data
472
473
				if( $map )
474
				{
475
					$customer = $manager->save( $customer->fromArray( $map, true ) );
476
477
					$processor->process( $customer, $list );
0 ignored issues
show
Bug introduced by
It seems like $customer can also be of type Aimeos\Map; however, parameter $customer of Aimeos\Controller\Jobs\C...cessor\Iface::process() does only seem to accept Aimeos\MShop\Customer\Item\Iface, maybe add an additional type check? ( Ignorable by Annotation )

If this is a false-positive, you can also ignore this issue in your code via the ignore-type  annotation

477
					$processor->process( /** @scrutinizer ignore-type */ $customer, $list );
Loading history...
478
479
					$customer = $manager->save( $customer );
480
					$items[$customer->getId()] = $customer;
481
				}
482
483
				$manager->commit();
484
			}
485
			catch( \Throwable $t )
486
			{
487
				$manager->rollback();
488
489
				$msg = sprintf( 'Unable to import customer with code "%1$s": %2$s', $code, $t->getMessage() );
490
				$context->logger()->error( $msg, 'import/csv/customer' );
491
492
				$errors++;
493
			}
494
		}
495
496
		return $errors;
497
	}
498
499
500
	/**
501
	 * Returns the path to the directory with the CSV file
502
	 *
503
	 * @return string Path to the directory with the CSV file
504
	 */
505
	protected function location() : string
506
	{
507
		/** controller/jobs/customer/import/csv/location
508
		 * Directory where the CSV files are stored which should be imported
509
		 *
510
		 * It's the relative path inside the "fs-import" virtual file system
511
		 * configuration. The default location of the "fs-import" file system is:
512
		 *
513
		 * * Laravel: ./storage/import/
514
		 * * TYPO3: /uploads/tx_aimeos/.secure/import/
515
		 *
516
		 * @param string Relative path to the CSV files
517
		 * @since 2015.08
518
		 * @see controller/jobs/customer/import/csv/backup
519
		 * @see controller/jobs/customer/import/csv/cleanup
520
		 * @see controller/jobs/customer/import/csv/domains
521
		 * @see controller/jobs/customer/import/csv/location
522
		 * @see controller/jobs/customer/import/csv/mapping
523
		 * @see controller/jobs/customer/import/csv/max-size
524
		 * @see controller/jobs/customer/import/csv/skip-lines
525
		 */
526
		return (string) $this->context()->config()->get( 'controller/jobs/customer/import/csv/location', 'customer' );
527
	}
528
529
530
	/**
531
	 * Returns the CSV column mapping
532
	 *
533
	 * @return array CSV column mapping
534
	 */
535
	protected function mapping() : array
536
	{
537
		/** controller/jobs/customer/import/csv/mapping
538
		 * List of mappings between the position in the CSV file and item keys
539
		 *
540
		 * The importer have to know which data is at which position in the CSV
541
		 * file. Therefore, you need to specify a mapping between each position
542
		 * and the MShop domain item key (e.g. "customer.code") it represents.
543
		 *
544
		 * You can use all domain item keys which are used in the fromArray()
545
		 * methods of the item classes.
546
		 *
547
		 * These mappings are grouped together by their processor names, which
548
		 * are responsible for importing the data, e.g. all mappings in "item"
549
		 * will be processed by the base customer importer while the mappings in
550
		 * "text" will be imported by the text processor.
551
		 *
552
		 * @param array Associative list of processor names and lists of key/position pairs
553
		 * @since 2025.10
554
		 * @see controller/jobs/customer/import/csv/backup
555
		 * @see controller/jobs/customer/import/csv/cleanup
556
		 * @see controller/jobs/customer/import/csv/domains
557
		 * @see controller/jobs/customer/import/csv/location
558
		 * @see controller/jobs/customer/import/csv/max-size
559
		 * @see controller/jobs/customer/import/csv/skip-lines
560
		 */
561
		$map = (array) $this->context()->config()->get( 'controller/jobs/customer/import/csv/mapping', $this->getDefaultMapping() );
562
563
		if( !isset( $map['item'] ) || !is_array( $map['item'] ) )
564
		{
565
			$msg = sprintf( 'Required mapping key "%1$s" is missing or contains no array', 'item' );
566
			throw new \Aimeos\Controller\Jobs\Exception( $msg );
567
		}
568
569
		return $map;
570
	}
571
572
573
	/**
574
	 * Returns the maximum number of CSV rows to import at once
575
	 *
576
	 * @return int Maximum number of CSV rows to import at once
577
	 */
578
	protected function max() : int
579
	{
580
		/** controller/jobs/customer/import/csv/max-size
581
		 * Maximum number of CSV rows to import at once
582
		 *
583
		 * It's more efficient to read and import more than one row at a time
584
		 * to speed up the import. Usually, the bigger the chunk that is imported
585
		 * at once, the less time the importer will need. The downside is that
586
		 * the amount of memory required by the import process will increase as
587
		 * well. Therefore, it's a trade-off between memory consumption and
588
		 * import speed.
589
		 *
590
		 * @param integer Number of rows
591
		 * @since 2025.10
592
		 * @see controller/jobs/customer/import/csv/backup
593
		 * @see controller/jobs/customer/import/csv/cleanup
594
		 * @see controller/jobs/customer/import/csv/domains
595
		 * @see controller/jobs/customer/import/csv/location
596
		 * @see controller/jobs/customer/import/csv/mapping
597
		 * @see controller/jobs/customer/import/csv/skip-lines
598
		 */
599
		return (int) $this->context()->config()->get( 'controller/jobs/customer/import/csv/max-size', 1000 );
600
	}
601
602
603
	/**
604
	 * Returns the number of rows skipped in front of each CSV files
605
	 *
606
	 * @return int Number of rows skipped in front of each CSV files
607
	 */
608
	protected function skip() : int
609
	{
610
		/** controller/jobs/customer/import/csv/skip-lines
611
		 * Number of rows skipped in front of each CSV files
612
		 *
613
		 * Some CSV files contain header information describing the content of
614
		 * the column values. These data is for informational purpose only and
615
		 * can't be imported into the database. Using this option, you can
616
		 * define the number of lines that should be left out before the import
617
		 * begins.
618
		 *
619
		 * @param integer Number of rows
620
		 * @since 2015.08
621
		 * @see controller/jobs/customer/import/csv/backup
622
		 * @see controller/jobs/customer/import/csv/cleanup
623
		 * @see controller/jobs/customer/import/csv/domains
624
		 * @see controller/jobs/customer/import/csv/location
625
		 * @see controller/jobs/customer/import/csv/mapping
626
		 * @see controller/jobs/customer/import/csv/max-size
627
		 */
628
		return (int) $this->context()->config()->get( 'controller/jobs/customer/import/csv/skip-lines', 0 );
629
	}
630
}
631