1 | <?php |
||
15 | class ResetAccountCommand extends ContainerAwareCommand |
||
16 | { |
||
17 | /** |
||
18 | * The input. |
||
19 | * |
||
20 | * @var InputInterface |
||
21 | */ |
||
22 | protected $input; |
||
23 | |||
24 | /** |
||
25 | * The output. |
||
26 | * |
||
27 | * @var OutputInterface |
||
28 | */ |
||
29 | protected $output; |
||
30 | |||
31 | /** |
||
32 | * {@inheritdoc} |
||
33 | */ |
||
34 | protected function configure() |
||
35 | { |
||
36 | $this |
||
37 | ->setName('sp210:fastbill:reset') |
||
38 | ->setDescription('Reset (delete) the data from the Fastbill account') |
||
39 | ->addOption( |
||
40 | 'reset-customers', |
||
41 | null, |
||
42 | InputOption::VALUE_NONE, |
||
43 | 'Flag if the customers should be reset' |
||
44 | ) |
||
45 | ->addOption( |
||
46 | 'id', |
||
47 | null, |
||
48 | InputOption::VALUE_REQUIRED, |
||
49 | 'Customer ID to reset' |
||
50 | ) |
||
51 | ->addOption( |
||
52 | 'ext-id', |
||
53 | null, |
||
54 | InputOption::VALUE_REQUIRED, |
||
55 | 'Optional external ID' |
||
56 | ) |
||
57 | ->addOption( |
||
58 | 'skip-id', |
||
59 | null, |
||
60 | InputOption::VALUE_REQUIRED | InputOption::VALUE_IS_ARRAY, |
||
61 | 'Customer ID to skip' |
||
62 | ) |
||
63 | ->addOption( |
||
64 | 'skip-ext-id', |
||
65 | null, |
||
66 | InputOption::VALUE_REQUIRED | InputOption::VALUE_IS_ARRAY, |
||
67 | 'Customer external ID to skip' |
||
68 | ); |
||
69 | } |
||
70 | |||
71 | /** |
||
72 | * {@inheritdoc} |
||
73 | */ |
||
74 | protected function execute(InputInterface $input, OutputInterface $output) |
||
98 | |||
99 | /** |
||
100 | * Reset all customers including subscriptions, but not invoices. |
||
101 | */ |
||
102 | protected function resetCustomers() |
||
144 | } |
||
145 |