vendor/kaliop/ezmigrationbundle/Core/Helper/ConsoleIO.php line 15

Open in your IDE?
  1. <?php
  2. namespace Kaliop\eZMigrationBundle\Core\Helper;
  3. use Symfony\Component\Console\Event\ConsoleCommandEvent;
  4. /**
  5.  * 'Saves' the console IO channels to make them available to whoever needs them, eg. kinky php migrations...
  6.  */
  7. class ConsoleIO
  8. {
  9.     protected $input;
  10.     protected $output;
  11.     public function onConsoleCommand(ConsoleCommandEvent $event) {
  12.         $this->input $event->getInput();
  13.         $this->output $event->getOutput();
  14.     }
  15.     /**
  16.      * NB: will return NULL when called from anything else but a console application context!
  17.      * @return \Symfony\Component\Console\Input\InputInterface
  18.      */
  19.     public function getInput()
  20.     {
  21.         return $this->input;
  22.     }
  23.     /**
  24.      * NB: will return NULL when called from anything else but a console application context!
  25.      * @return \Symfony\Component\Console\Output\OutputInterface
  26.      */
  27.     public function getOutput()
  28.     {
  29.         return $this->output;
  30.     }
  31. }