You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

MultipleCommand.php 750B

1234567891011121314151617181920212223242526272829303132333435363738
  1. <?php
  2. /**
  3. * Created by PhpStorm.
  4. * User: robin
  5. * Date: 11/24/15
  6. * Time: 12:15 AM
  7. */
  8. namespace App\Http\Business\Commands;
  9. use App\Http\DBO\CommandsDbo;
  10. class MultipleCommand extends AbstractCommand
  11. {
  12. /**
  13. * @return bool
  14. */
  15. public function exec()
  16. {
  17. $data = $this->_command->getData();
  18. $commands = $data["Commands"];
  19. foreach ($commands as $command) {
  20. $type = $command["Type"];
  21. $data = $command["Data"];
  22. $class = "App\Http\Business\Commands\\" . $type . "Command";
  23. $commandDbo = new CommandsDbo();
  24. $commandDbo->setData($data);
  25. $cmd = new $class($commandDbo);
  26. $cmd->exec();
  27. }
  28. return true;
  29. }
  30. }