WhmcsParams.php 660 B

123456789101112131415161718192021222324252627282930313233
  1. <?php
  2. namespace ModulesGarden\ProxmoxAddon\Core\Helper;
  3. /**
  4. * Wrapper for WHMCS params passed to controler functions
  5. *
  6. * @author Sławomir Miśkowicz <slawomir@modulesgarden.com>
  7. */
  8. class WhmcsParams
  9. {
  10. private $params = [];
  11. public function setParams($params = [])
  12. {
  13. if (is_array($params))
  14. {
  15. $this->params = $params;
  16. }
  17. return $this;
  18. }
  19. public function getParamByKey($key, $default = false)
  20. {
  21. return isset($this->params[$key]) ? $this->params[$key] : $default;
  22. }
  23. public function getWhmcsParams()
  24. {
  25. return $this->params;
  26. }
  27. }