mirror of
https://github.com/JBDevLabs/ezmigrationbundle.git
synced 2026-03-24 08:52:16 +01:00
38 lines
954 B
PHP
38 lines
954 B
PHP
<?php
|
|
|
|
namespace Kaliop\eZMigrationBundle\Core\Helper;
|
|
|
|
use Symfony\Component\Console\Event\ConsoleCommandEvent;
|
|
|
|
/**
|
|
* 'Saves' the console IO channels to make them available to whoever needs them, eg. kinky php migrations...
|
|
*/
|
|
class ConsoleIO
|
|
{
|
|
protected $input;
|
|
protected $output;
|
|
|
|
public function onConsoleCommand(ConsoleCommandEvent $event) {
|
|
$this->input = $event->getInput();
|
|
$this->output = $event->getOutput();
|
|
}
|
|
|
|
/**
|
|
* NB: will return NULL when called from anything else but a console application context!
|
|
* @return \Symfony\Component\Console\Input\InputInterface
|
|
*/
|
|
public function getInput()
|
|
{
|
|
return $this->input;
|
|
}
|
|
|
|
/**
|
|
* NB: will return NULL when called from anything else but a console application context!
|
|
* @return \Symfony\Component\Console\Output\OutputInterface
|
|
*/
|
|
public function getOutput()
|
|
{
|
|
return $this->output;
|
|
}
|
|
}
|