ModelNotFoundException.php 1.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445
  1. <?php
  2. // +----------------------------------------------------------------------
  3. // | ThinkPHP [ WE CAN DO IT JUST THINK ]
  4. // +----------------------------------------------------------------------
  5. // | Copyright (c) 2006~2018 http://thinkphp.cn All rights reserved.
  6. // +----------------------------------------------------------------------
  7. // | Licensed ( http://www.apache.org/licenses/LICENSE-2.0 )
  8. // +----------------------------------------------------------------------
  9. // | Author: 麦当苗儿 <zuojiazi@vip.qq.com> <http://zjzit.cn>
  10. // +----------------------------------------------------------------------
  11. namespace think\db\exception;
  12. use think\exception\DbException;
  13. class ModelNotFoundException extends DbException
  14. {
  15. protected $model;
  16. /**
  17. * 构造方法
  18. * @access public
  19. * @param string $message
  20. * @param string $model
  21. * @param array $config
  22. */
  23. public function __construct($message, $model = '', array $config = [])
  24. {
  25. $this->message = $message;
  26. $this->model = $model;
  27. $this->setData('Database Config', $config);
  28. }
  29. /**
  30. * 获取模型类名
  31. * @access public
  32. * @return string
  33. */
  34. public function getModel()
  35. {
  36. return $this->model;
  37. }
  38. }