ModelNotFoundException.php 1.2 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243
  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. * @param string $message
  19. * @param string $model
  20. */
  21. public function __construct($message, $model = '', array $config = [])
  22. {
  23. $this->message = $message;
  24. $this->model = $model;
  25. $this->setData('Database Config', $config);
  26. }
  27. /**
  28. * 获取模型类名
  29. * @access public
  30. * @return string
  31. */
  32. public function getModel()
  33. {
  34. return $this->model;
  35. }
  36. }