Standard::getName()   A
last analyzed

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
	/**
132
	 * Returns the localized name of the job.
133
	 *
134
	 * @return string Name of the job
135
	 */
136
	public function getName() : string
137
	{
138
		return $this->context()->translate( 'controller/jobs', 'Customer import CSV' );
139
	}
140
141
142
	/**
143
	 * Returns the localized description of the job.
144
	 *
145
	 * @return string Description of the job
146
	 */
147
	public function getDescription() : string
148
	{
149
		return $this->context()->translate( 'controller/jobs', 'Imports new and updates existing customers from CSV files' );
150
	}
151
152
153
	/**
154
	 * Executes the job.
155
	 *
156
	 * @throws \Aimeos\Controller\Jobs\Exception If an error occurs
157
	 */
158
	public function run()
159
	{
160
		$context = $this->context();
161
		$logger = $context->logger();
162
		$date = date( 'Y-m-d H:i:s' );
163
164
		try
165
		{
166
			$files = $errors = 0;
167
			$fs = $context->fs( 'fs-import' );
168
			$site = $context->locale()->getSiteItem()->getCode();
169
			$location = $this->location() . '/' . $site;
170
171
			if( $fs->isDir( $location ) === false ) {
172
				return;
173
			}
174
175
			$logger->info( sprintf( 'Started customer import from "%1$s"', $location ), 'import/csv/customer' );
176
177
			foreach( map( $fs->scan( $location ) )->sort() as $filename )
178
			{
179
				$path = $location . '/' . $filename;
180
181
				if( $filename[0] === '.' || $fs instanceof \Aimeos\Base\Filesystem\DirIface && $fs->isDir( $path ) ) {
182
					continue;
183
				}
184
185
				$errors = $this->import( $path );
186
				$files++;
187
			}
188
189
			/** controller/jobs/customer/import/csv/cleanup
190
			 * Deletes all customers with categories which havn't been updated
191
			 *
192
			 * By default, the customer importer only adds new and updates existing
193
			 * customers but doesn't delete any customers. If you want to remove all
194
			 * customers which haven't been updated during the import, then set this
195
			 * configuration option to "true". This will remove all customers which
196
			 * are not assigned to any category but keep the ones without categories,
197
			 * e.g. rebate customers.
198
			 *
199
			 * @param bool TRUE to delete all untouched customers, FALSE to keep them
200
			 * @since 2025.10
201
			 * @see controller/jobs/customer/import/csv/backup
202
			 * @see controller/jobs/customer/import/csv/domains
203
			 * @see controller/jobs/customer/import/csv/location
204
			 * @see controller/jobs/customer/import/csv/mapping
205
			 * @see controller/jobs/customer/import/csv/max-size
206
			 * @see controller/jobs/customer/import/csv/skip-lines
207
			 */
208
			if( $files && $context->config()->get( 'controller/jobs/customer/import/csv/cleanup', false ) )
209
			{
210
				$count = $this->cleanup( $date );
211
				$logger->info( sprintf( 'Cleaned %1$s old customers', $count ), 'import/csv/customer' );
212
			}
213
214
			if( $errors > 0 ) {
215
				$this->mail( 'Customer CSV import', sprintf( 'Invalid customer lines during import: %1$d', $errors ) );
216
			}
217
218
			$logger->info( sprintf( 'Finished customer import from "%1$s"', $location ), 'import/csv/customer' );
219
		}
220
		catch( \Exception $e )
221
		{
222
			$logger->error( 'Customer import error: ' . $e->getMessage() . "\n" . $e->getTraceAsString(), 'import/csv/customer' );
223
			$this->mail( 'Customer CSV import error', $e->getMessage() . "\n" . $e->getTraceAsString() );
224
			throw new \Aimeos\Controller\Jobs\Exception( $e->getMessage() );
225
		}
226
	}
227
228
229
	/**
230
	 * Returns the directory for storing imported files
231
	 *
232
	 * @return string Directory for storing imported files
233
	 */
234
	protected function backup() : string
235
	{
236
		/** controller/jobs/customer/import/csv/backup
237
		 * Name of the backup for sucessfully imported files
238
		 *
239
		 * After a CSV file was imported successfully, you can move it to another
240
		 * location, so it won't be imported again and isn't overwritten by the
241
		 * next file that is stored at the same location in the file system.
242
		 *
243
		 * You should use an absolute path to be sure but can be relative path
244
		 * if you absolutely know from where the job will be executed from. The
245
		 * name of the new backup location can contain placeholders understood
246
		 * by the PHP DateTime::format() method (with percent signs prefix) to
247
		 * create dynamic paths, e.g. "backup/%Y-%m-%d" which would create
248
		 * "backup/2000-01-01". For more information about the date() placeholders,
249
		 * please have a look  into the PHP documentation of the
250
		 * {@link https://www.php.net/manual/en/datetime.format.php format() method}.
251
		 *
252
		 * **Note:** If no backup name is configured, the file will be removed!
253
		 *
254
		 * @param integer Name of the backup file, optionally with date/time placeholders
255
		 * @since 2025.10
256
		 * @see controller/jobs/customer/import/csv/cleanup
257
		 * @see controller/jobs/customer/import/csv/domains
258
		 * @see controller/jobs/customer/import/csv/location
259
		 * @see controller/jobs/customer/import/csv/mapping
260
		 * @see controller/jobs/customer/import/csv/max-size
261
		 * @see controller/jobs/customer/import/csv/skip-lines
262
		 */
263
		$backup = $this->context()->config()->get( 'controller/jobs/customer/import/csv/backup' );
264
		return \Aimeos\Base\Str::strtime( (string) $backup );
265
	}
266
267
268
	/**
269
	 * Cleans up the given list of customer items
270
	 *
271
	 * @param \Aimeos\Map $customers List of customer items implementing \Aimeos\MShop\Customer\Item\Iface
272
	 */
273
	protected function clean( \Aimeos\Map $customers )
274
	{
275
		$manager = \Aimeos\MShop::create( $this->context(), 'customer' );
276
277
		$manager->begin();
278
		$manager->save( $customers->setStatus( -2 ) );
279
		$manager->commit();
280
	}
281
282
283
	/**
284
	 * Adds conditions to the filter for fetching customers that should be removed
285
	 *
286
	 * @param \Aimeos\Base\Criteria\Iface $filter Criteria object
287
	 * @return \Aimeos\Base\Criteria\Iface Modified criteria object
288
	 */
289
	protected function cleaner( \Aimeos\Base\Criteria\Iface $filter ) : \Aimeos\Base\Criteria\Iface
290
	{
291
		return $filter;
292
	}
293
294
295
	/**
296
	 * Removes all customers which have been updated before the given date/time
297
	 *
298
	 * @param string $datetime Date and time in ISO format
299
	 * @return int Number of removed customers
300
	 */
301
	protected function cleanup( string $datetime ) : int
302
	{
303
		$count = 0;
304
		$manager = \Aimeos\MShop::create( $this->context(), 'customer' );
305
306
		$filter = $manager->filter();
307
		$filter->add( 'customer.mtime', '<', $datetime );
308
		$cursor = $manager->cursor( $this->call( 'cleaner', $filter ) );
309
310
		while( $items = $manager->iterate( $cursor, ['customer' => ['default']] ) )
311
		{
312
			$this->call( 'clean', $items );
313
			$count += count( $items );
314
		}
315
316
		return $count;
317
	}
318
319
320
	/**
321
	 * Returns the list of domain names that should be retrieved along with the attribute items
322
	 *
323
	 * @return array List of domain names
324
	 */
325
	protected function domains() : array
326
	{
327
		$default = ['customer/address', 'customer/property'];
328
329
		/** controller/jobs/customer/import/csv/domains
330
		 * List of item domain names that should be retrieved along with the customer items
331
		 *
332
		 * For efficient processing, the items associated to the customers can be
333
		 * fetched to, minimizing the number of database queries required. To be
334
		 * most effective, the list of item domain names should be used in the
335
		 * mapping configuration too, so the retrieved items will be used during
336
		 * the import.
337
		 *
338
		 * @param array Associative list of MShop item domain names
339
		 * @since 2025.10
340
		 * @see controller/jobs/customer/import/csv/backup
341
		 * @see controller/jobs/customer/import/csv/cleanup
342
		 * @see controller/jobs/customer/import/csv/location
343
		 * @see controller/jobs/customer/import/csv/mapping
344
		 * @see controller/jobs/customer/import/csv/max-size
345
		 * @see controller/jobs/customer/import/csv/skip-lines
346
		 */
347
		return $this->context()->config()->get( 'controller/jobs/customer/import/csv/domains', $default );
348
	}
349
350
351
	/**
352
	 * Returns the position of the "customer.code" column from the customer item mapping
353
	 *
354
	 * @param array $mapping Mapping of the "item" columns with position as key and code as value
355
	 * @return int Position of the "customer.code" column
356
	 * @throws \Aimeos\Controller\Jobs\Exception If no mapping for "customer.code" is found
357
	 */
358
	protected function getCodePosition( array $mapping ) : int
359
	{
360
		foreach( $mapping as $pos => $key )
361
		{
362
			if( $key === 'customer.code' ) {
363
				return $pos;
364
			}
365
		}
366
367
		throw new \Aimeos\Controller\Jobs\Exception( sprintf( 'No "customer.code" column in CSV mapping found' ) );
368
	}
369
370
371
	/**
372
	 * Returns the customer items for the given codes
373
	 *
374
	 * @param array $codes List of customer codes
375
	 * @param array $domains List of domains whose items should be fetched too
376
	 * @return \Aimeos\Map Associative list of customer codes as key and customer items as value
377
	 */
378
	protected function getCustomers( array $codes, array $domains ) : \Aimeos\Map
379
	{
380
		$manager = \Aimeos\MShop::create( $this->context(), 'customer' );
381
		$search = $manager->filter()->add( ['customer.code' => $codes] )->slice( 0, count( $codes ) );
382
383
		return $manager->search( $search, $domains )->col( null, 'customer.code' );
384
	}
385
386
387
	/**
388
	 * Imports the CSV file from the given path
389
	 *
390
	 * @param string $path Relative path to the CSV file
391
	 * @return int Number of lines which couldn't be imported
392
	 */
393
	protected function import( string $path ) : int
394
	{
395
		$context = $this->context();
396
		$logger = $context->logger();
397
398
		$logger->info( sprintf( 'Started customer import from "%1$s"', $path ), 'import/csv/customer' );
399
400
		$maxcnt = $this->max();
401
		$skiplines = $this->skip();
402
		$domains = $this->domains();
403
404
		$mappings = $this->mapping();
405
		$processor = $this->getProcessors( $mappings );
406
		$codePos = $this->getCodePosition( $mappings['item'] );
407
408
		$fs = $context->fs( 'fs-import' );
409
		$fh = $fs->reads( $path );
410
		$total = $errors = 0;
411
412
		for( $i = 0; $i < $skiplines; $i++ ) {
413
			fgetcsv( $fh, null, ',', '"', '' );
414
		}
415
416
		while( ( $data = $this->getData( $fh, $maxcnt, $codePos ) ) !== [] )
417
		{
418
			$customers = $this->getCustomers( array_keys( $data ), $domains );
419
			$errors += $this->importCustomers( $customers, $data, $mappings['item'], [], $processor );
420
421
			$total += count( $data );
422
			unset( $customers, $data );
423
		}
424
425
		$processor->finish();
426
		fclose( $fh );
427
428
		if( !empty( $backup = $this->backup() ) ) {
429
			$fs->move( $path, $backup );
430
		} else {
431
			$fs->rm( $path );
432
		}
433
434
		$str = sprintf( 'Finished customer import from "%1$s" (%2$d/%3$d)', $path, $errors, $total );
435
		$logger->info( $str, 'import/csv/customer' );
436
437
		return $errors;
438
	}
439
440
441
	/**
442
	 * Imports the CSV data and creates new customers or updates existing ones
443
	 *
444
	 * @param \Aimeos\Map $customers List of customers items implementing \Aimeos\MShop\Customer\Item\Iface
445
	 * @param array $data Associative list of import data as index/value pairs
446
	 * @param array $mapping Associative list of positions and domain item keys
447
	 * @param array $types List of allowed customer type codes
448
	 * @param \Aimeos\Controller\Jobs\Common\Customer\Import\Csv\Processor\Iface $processor Processor object
449
	 * @return int Number of customers that couldn't be imported
450
	 * @throws \Aimeos\Controller\Jobs\Exception
451
	 */
452
	protected function importCustomers( \Aimeos\Map $customers, array $data, array $mapping, array $types,
453
		\Aimeos\Controller\Jobs\Common\Customer\Import\Csv\Processor\Iface $processor ) : int
454
	{
455
		$items = [];
456
		$errors = 0;
457
		$context = $this->context();
458
		$manager = \Aimeos\MShop::create( $context, 'customer' );
459
460
		foreach( $data as $code => $list )
461
		{
462
			$manager->begin();
463
464
			try
465
			{
466
				$code = trim( $code );
467
				$customer = $customers[$code] ?? $manager->create();
468
				$map = current( $this->getMappedChunk( $list, $mapping ) ); // there can only be one chunk for the base customer data
469
470
				if( $map )
471
				{
472
					$this->check( $map );
473
					$customer = $manager->save( $customer->fromArray( $map, true ) );
474
475
					$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

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