Handle.php 393 B

12345678910111213141516171819202122
  1. <?php
  2. namespace Cmbc;
  3. class Handle
  4. {
  5. public function get($method, $setting)
  6. {
  7. $class = $this->config($method);
  8. $class = new $class($setting);
  9. return $class;
  10. }
  11. private function config($method)
  12. {
  13. $config['order'] = '\\Cmbc\\Api\\UnifiedOrder';
  14. $config['notify'] = '\\Cmbc\\Api\\Notify';
  15. if (isset($config[$method])) {
  16. return $config[$method];
  17. }
  18. }
  19. }