tags:

views:

180

answers:

1

Hello.

I encountered a problem dealing with views in Doctrine.

I have the following view in my database:

$q = Doctrine_Query::create()
                        ->select('c.id, c.name, m.id, m.name, m.status, 
                                  m.modified, m.entered, m.accountid')
                        ->from('Category c')
                        ->leftJoin('c.Mailing m');
$view = new Doctrine_View($q, 'view_mailings');
$q->execute(array(), Doctrine::HYDRATE_ARRAY);

The result comprises of all records. However I need to fetch a subset based on different value for accountid and ordered by different columns. How can I achieve this?

Thanks for your help.

A: 

You are just executing the query $q, without using the view you have created.

Roberto
Sorry, but there is not much sense in your answer. If I wanted to use straight query, I wouldn't bother at all to make views in the database.