Hi y'all!

I am working on a board-type app, using a database model that
implements Doctrine's Nested Set behaviour. A hierarchical model where
Categories have Sub-categories that in turn have Ads.

I am fetching my data with only one query by using the documented
method Doctrine_Tree_NestedSet::fetchTree(), as so:

<code>

$q = Doctrine_Query::create()
    ->select('c.name, a.title')
    ->from('Category c')
    ->leftJoin('c.Ads a')
    ->where('c.name = ?',  $cat_name)
    ->setHydrationMode(Doctrine_Core::HYDRATE_ARRAY);

$rootColumnName = $this->category->getRootId();

$options = array(
  'root_id' => $rootColumnName
);

</code>

I am able to iterate the resulting array after calling (on the View):

<code>

$categories = $sf_data->get('descendants');

</code>

Here's where the plot thickens. 8-)

How can I use the built-in pagination functionality of Doctrine on the
result?

The class sfDoctrinePager expects a query, which I cannot provide
given that I had to pass a query in the first place to be able to use
the Doctrine_Tree_NestedSet::fetchTree() method.

Ideas, anyone?

-- 
If you want to report a vulnerability issue on symfony, please send it to 
security at symfony-project.com

You received this message because you are subscribed to the Google
Groups "symfony users" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/symfony-users?hl=en

Reply via email to