Doctrine find() 函数正在运行,但它首先返回 DQL,然后再返回对象。我不想显示 DQL

Doctrine find() function is working but it is returning DQL first then the object. I don't want to display DQL

我的密码是

public function index() {

        $user = $this->doctrine->em->find('user\models\User', 1);

        echo '<br>';      

        echo $user->getName();
}

输出是

SELECT t0.id AS id1, t0.name AS name2 FROM tbl_user t0 WHERE t0.id = ? array(1) { [0]=> int(1) } array(1) { [0]=> string(7) "integer" }

约翰

我使用了 CodeIgniter 2.2.2 并且我已经使用这些步骤集成了学说link

我终于解决了这个问题。我不得不在库文件夹的 Doctrine.php 文件中评论 EchoSQLLogger()。

    // Set up logger
    //$logger = new EchoSQLLogger;
    //$config->setSQLLogger($logger);