0

I'm trying to execute this:

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

I'm getting: No description for object of class "stuff". What am I doing wrong?

Academia
  • 3,984
  • 6
  • 32
  • 49

2 Answers2

0

I just find it. It was fetchOne() instead of execute(). Thanks.

Academia
  • 3,984
  • 6
  • 32
  • 49
0

user1038382:

Go to the definition of your class, at lib\model\doctrine , and add the following function inside the class:

public function __toString() {
   parent::__toString();
   return $this->getNameOfTheFieldYouWantToDisplay();
}
Joel Hernandez
  • 2,195
  • 1
  • 13
  • 17