|
1
|
|
|
<?php |
|
2
|
|
|
|
|
3
|
|
|
/** |
|
4
|
|
|
* TechDivision\Import\Cli\Command\AbstractShortcutAwareImportCommand |
|
5
|
|
|
* |
|
6
|
|
|
* PHP version 7 |
|
7
|
|
|
* |
|
8
|
|
|
* @author Tim Wagner <[email protected]> |
|
9
|
|
|
* @copyright 2019 TechDivision GmbH <[email protected]> |
|
10
|
|
|
* @license https://opensource.org/licenses/MIT |
|
11
|
|
|
* @link https://github.com/techdivision/import-cli-simple |
|
12
|
|
|
* @link http://www.techdivision.com |
|
13
|
|
|
*/ |
|
14
|
|
|
|
|
15
|
|
|
namespace TechDivision\Import\Cli\Command; |
|
16
|
|
|
|
|
17
|
|
|
use TechDivision\Import\Utils\OperationKeys; |
|
18
|
|
|
use Symfony\Component\Console\Input\InputArgument; |
|
19
|
|
|
use TechDivision\Import\Utils\InputArgumentKeysInterface; |
|
20
|
|
|
|
|
21
|
|
|
/** |
|
22
|
|
|
* The command implementation for shortcut aware import commands. |
|
23
|
|
|
* |
|
24
|
|
|
* @author Tim Wagner <[email protected]> |
|
25
|
|
|
* @copyright 2019 TechDivision GmbH <[email protected]> |
|
26
|
|
|
* @license https://opensource.org/licenses/MIT |
|
27
|
|
|
* @link https://github.com/techdivision/import-cli-simple |
|
28
|
|
|
* @link http://www.techdivision.com |
|
29
|
|
|
*/ |
|
30
|
|
|
abstract class AbstractShortcutAwareImportCommand extends AbstractImportCommand |
|
31
|
|
|
{ |
|
32
|
|
|
|
|
33
|
|
|
/** |
|
34
|
|
|
* Configures the current command. |
|
35
|
|
|
* |
|
36
|
|
|
* @return void |
|
37
|
|
|
* @see \Symfony\Component\Console\Command\Command::configure() |
|
38
|
|
|
*/ |
|
39
|
|
|
protected function configure() |
|
40
|
|
|
{ |
|
41
|
|
|
|
|
42
|
|
|
// initialize the command with the required/optional options |
|
43
|
|
|
$this->addArgument(InputArgumentKeysInterface::SHORTCUT, InputArgument::OPTIONAL, 'The shortcut that defines the operation(s) that has to be used for the import, one of "add-update", "replace", "delete" or "convert" or a combination of them', OperationKeys::ADD_UPDATE) |
|
44
|
|
|
->addArgument(InputArgumentKeysInterface::FILENAME, InputArgument::OPTIONAL, 'An explicit filename that should be imported'); |
|
45
|
|
|
|
|
46
|
|
|
// invoke the parent method |
|
47
|
|
|
parent::configure(); |
|
48
|
|
|
} |
|
49
|
|
|
} |
|
50
|
|
|
|