Advertisement
Guest User

Untitled

a guest
Feb 11th, 2016
58
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.02 KB | None | 0 0
  1. <?php
  2.  
  3. class RemoteController
  4. {
  5. private $onOffCommand;
  6. private $nextChannelCommand;
  7. private $previousChannelCommand;
  8. private $volumeUpCommand;
  9. private $volumeDownCommand;
  10.  
  11. public function __construct(TV $tv)
  12. {
  13. $this->onOffCommand = new OnOffCommand($tv);
  14. $this->nextChannelCommand = new NextChannelCommand($tv);
  15. $this->previousChannelCommand = new PreviousChannelCommand($tv);
  16. $this->volumeUpCommand = new VolumeUpCommand($tv);
  17. $this->volumeDownCommand = new VolumeDownCommand($tv);
  18. }
  19.  
  20. public function onOffButton()
  21. {
  22. $this->onOffCommand->execute();
  23. }
  24.  
  25. public function nextChannelButton()
  26. {
  27. $this->nextChannelCommand->execute();
  28. }
  29.  
  30. public function previousChannelButton()
  31. {
  32. $this->previousChannelCommand->execute();
  33. }
  34.  
  35. public function volumeUpButton()
  36. {
  37. $this->volumeUpCommand->execute();
  38. }
  39.  
  40. public function volumeDownButton()
  41. {
  42. $this->volumeDownCommand->execute();
  43. }
  44. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement