Pivot.php 1.0 KB

123456789101112131415161718192021222324252627282930313233343536
  1. <?php
  2. // +----------------------------------------------------------------------
  3. // | ThinkPHP [ WE CAN DO IT JUST THINK ]
  4. // +----------------------------------------------------------------------
  5. // | Copyright (c) 2006~2017 http://thinkphp.cn All rights reserved.
  6. // +----------------------------------------------------------------------
  7. // | Licensed ( http://www.apache.org/licenses/LICENSE-2.0 )
  8. // +----------------------------------------------------------------------
  9. // | Author: liu21st <liu21st@gmail.com>
  10. // +----------------------------------------------------------------------
  11. namespace think\model;
  12. use think\Model;
  13. class Pivot extends Model
  14. {
  15. /**
  16. * 架构函数
  17. * @access public
  18. * @param array|object $data 数据
  19. * @param string $table 中间数据表名
  20. */
  21. public function __construct($data = [], $table = '')
  22. {
  23. if (is_object($data)) {
  24. $this->data = get_object_vars($data);
  25. } else {
  26. $this->data = $data;
  27. }
  28. $this->table = $table;
  29. }
  30. }