code.php 707 B

123456789101112131415161718192021222324252627282930313233343536
  1. <?php
  2. /**
  3. * 数据表的显示规则
  4. *
  5. * @author Jinhui Zhu<jinhui.zhu@live.cn> 2015-08-23 10:07
  6. */
  7. namespace Model;
  8. use \Qii\Driver\Model;
  9. use \Qii\Driver\Response;
  10. class code extends Model
  11. {
  12. public $tableName;
  13. public $codes = array();
  14. public function __construct()
  15. {
  16. parent::__construct();
  17. }
  18. public function setDatabase($database)
  19. {
  20. $this->database = $database;
  21. }
  22. public function setClass($tableName)
  23. {
  24. $this->tableName = $tableName;
  25. }
  26. public function output()
  27. {
  28. if(!$this->tableName) throw new \Exception("未设置类名", __LINE__);
  29. $output['className'] = $this->tableName;
  30. $output['database'] = $this->database;
  31. return $output;
  32. }
  33. }