[求助]模型查询 出来的数组带 :protected 是怎么回事?

浏览:4129 发布日期:2016/10/18 分类:ThinkPHP5专区 关键字: 模型查询
//user 模型
<?php
namespace app\admin\model;
use think\Model;
class User extends Model{

}

//实例化
    public function add(){
        echo '<pre>';
        var_dump( User::select() );
        echo '</pre>';       
    }

//结果是这样的:::
array(8) {
  [0]=>
  object(app\admin\model\User)#14 (26) {
    ["connection":protected]=>
    array(0) {
    }
    ["name":protected]=>
    string(4) "User"
    ["table":protected]=>
    NULL
    ["class":protected]=>
    string(20) "app\admin\model\User"
    ["error":protected]=>
    NULL
    ["validate":protected]=>
    NULL
    ["pk":protected]=>
    NULL
    ["field":protected]=>
    array(0) {
    }
    ["readonly":protected]=>
    array(0) {
    }
    ["visible":protected]=>
    array(0) {
    }
    ["hidden":protected]=>
    array(0) {
    }
    ["append":protected]=>
    array(0) {
    }
    ["data":protected]=>
    array(9) {
      ["id"]=>
      int(22)
      ["user"]=>
      string(4) "houn"
      ["name"]=>
      string(0) ""
      ["password"]=>
      string(32) "65b50b04a6af50bb2f174db30a8c6dad"
      ["note"]=>
      string(0) ""
      ["pid"]=>
      int(0)
      ["company"]=>
      string(0) ""
      ["address"]=>
      string(0) ""
      ["tel"]=>
      int(0)
    }
帮忙看下谢谢各位
最佳答案
评论( 相关
后面还有条评论,点击查看>>