HookEvent.php 559 B

12345678910111213141516171819202122232425262728
  1. <?php
  2. namespace Tools;
  3. class HookEvent
  4. {
  5. private $context;
  6. private $hookName;
  7. private $params;
  8. public function __construct($hookName, $context, $params)
  9. {
  10. $this->context = $context;
  11. $this->hookName = $hookName;
  12. $this->params = $params;
  13. }
  14. public function __get($key)
  15. {
  16. switch ($key)
  17. {
  18. case "hookName": return $this->hookName; break;
  19. case "params": return $this->params; break;
  20. }
  21. throw new \Exception("Cannot access attribute {$key}");
  22. }
  23. }