DataNotFoundException.php 1.3 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344
  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 DataNotFoundException extends DbException
  14. {
  15. protected $table;
  16. /**
  17. * DbException constructor.
  18. * @access public
  19. * @param string $message
  20. * @param string $table
  21. * @param array $config
  22. */
  23. public function __construct($message, $table = '', array $config = [])
  24. {
  25. $this->message = $message;
  26. $this->table = $table;
  27. $this->setData('Database Config', $config);
  28. }
  29. /**
  30. * 获取数据表名
  31. * @access public
  32. * @return string
  33. */
  34. public function getTable()
  35. {
  36. return $this->table;
  37. }
  38. }