【问题标题】:No description for object of class "stuff" in symfonysymfony 中没有对类“stuff”对象的描述
【发布时间】:2012-05-17 17:40:17
【问题描述】:

我正在尝试执行此操作:

    $q = Doctrine_Query::create()
      ->select('MAX(s.ID) AS max')
      ->from('stuff s')
      ->execute();

我得到:没有描述类“东西”的对象。 我做错了什么?

【问题讨论】:

    标签: symfony1 max doctrine-query


    【解决方案1】:

    我只是找到它。 它是 fetchOne() 而不是 execute()。 谢谢。

    【讨论】:

      【解决方案2】:

      user1038382:

      转到你的类的定义,在 lib\model\doctrine ,并在类中添加以下函数:

      public function __toString() {
         parent::__toString();
         return $this->getNameOfTheFieldYouWantToDisplay();
      }
      

      【讨论】:

        猜你喜欢
        • 2014-02-11
        • 2015-12-09
        • 2019-09-27
        • 2021-06-26
        • 2017-10-08
        • 1970-01-01
        • 1970-01-01
        • 2013-11-23
        • 2017-02-17
        相关资源
        最近更新 更多