tags:

views:

16

answers:

0

I just started out with Doctrine and it has been awesome so far. I have a little challenge though.

class TestTable extends Doctrine_Table
{

    public function getRecent()
    {                
        return $this->createQuery('Test')->execute();    
    }   

}

class Test extends Doctrine_Record
{
 public function setTableDefinition()
 {
  $this->hasColumn('test_id', 'integer');
  $this->hasColumn('user_id', 'integer');
                $this->hasColumn('date_registered', 'timestamp');
        }

        public function getDateRegistered()
        {
                return 'formattedDate';
        }

}

Calling the getDateRegistered function results in an undefined method error. Coming from a Zend Background, This is taken care of by writing your table queries like this

$table = new Zend_Db_Table(array('name'=>TableConstants::AUTH_CODE,'rowClass'=>'AuthCode'));
  return $table->fetchRow($table->select()->where('id = ?',$id));

Can I do something Like this in Doctrine? Specifiying the Row Class while queryng the table?. Thank you