PurgeItemsCommand::execute()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 11
Code Lines 8

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
dl 0
loc 11
rs 9.4285
c 0
b 0
f 0
cc 1
eloc 8
nc 1
nop 2
1
<?php
2
3
namespace Rottenwood\KingdomBundle\Command\Console;
4
5
use Rottenwood\KingdomBundle\Command\Console\Integration\Truncate;
6
use Rottenwood\KingdomBundle\Entity\Infrastructure\Item;
7
use Rottenwood\KingdomBundle\Entity\InventoryItem;
8
use Rottenwood\KingdomBundle\Entity\RoomResource;
9
use Symfony\Component\Console\Input\InputInterface;
10
use Symfony\Component\Console\Output\OutputInterface;
11
12
/** {@inheritDoc} */
13
class PurgeItemsCommand extends Truncate
14
{
15
16
    /** {@inheritDoc} */
17
    protected function configure()
18
    {
19
        $this->setName('kingdom:purge:items')->setDescription('Удаление всех предметов');
20
    }
21
22
    /** {@inheritDoc} */
23
    protected function execute(InputInterface $input, OutputInterface $output)
24
    {
25
        $this->truncateEntity(
26
            InventoryItem::class,
27
            $output,
28
            'Удаление предметов в инвентарях ... ',
29
            'Инвентари удалены.'
30
        );
31
        $this->truncateEntity(Item::class, $output, 'Удаление предметов ... ', 'Предметы удалены.');
32
        $this->truncateEntity(RoomResource::class, $output, 'Удаление ресурсов ... ', 'Ресурсы удалены.');
33
    }
34
}
35