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