Welcome Guest, Not a member yet? Register   Sign In
pagination with doctrine how? thanks
#1

[eluser]Unknown[/eluser]
yeah i got a problem about the pagination with doctrine, this combinations can be done? how? some idea there? thanks
#2

[eluser]Nick Husher[/eluser]
You can do this with a DQL query and the limit and offset methods that chain off of Doctrine_Query::create().

Doctrine Manual
#3

[eluser]GSV Sleeper Service[/eluser]
Code:
$page = 1;
$results_per_page = 10;
$query = Doctrine_Query::create()->select(whatever);
$pager = new Doctrine_Pager(
            $query,
            $page,
            $results_per_page
        );
$results = $pager->execute(array(), Doctrine::HYDRATE_ARRAY);
$num_results = $results->getNumResults();
#4

[eluser]Nick Husher[/eluser]
Or that. Wink




Theme © iAndrew 2016 - Forum software by © MyBB