Files
Phraseanet/lib/Alchemy/Phrasea/Command/Task/TaskStop.php
Romain Neutron 13dd86c67f Fix CS
2013-10-31 14:22:41 +01:00

38 lines
991 B
PHP

<?php
/*
* This file is part of Phraseanet
*
* (c) 2005-2013 Alchemy
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/
namespace Alchemy\Phrasea\Command\Task;
use Alchemy\Phrasea\Command\Command;
use Symfony\Component\Console\Input\InputInterface;
use Symfony\Component\Console\Output\OutputInterface;
use Symfony\Component\Console\Input\InputArgument;
class TaskStop extends Command
{
public function __construct()
{
parent::__construct('task-manager:task:stop');
$this
->addArgument('task_id', InputArgument::REQUIRED, 'The task_id to stop')
->setDescription('Stops a task');
}
protected function doExecute(InputInterface $input, OutputInterface $output)
{
$task = $this->container['converter.task']->convert($input->getArgument('task_id'));
$this->container['manipulator.task']->stop($task);
return 0;
}
}