|
Hi,
It seems like the most vital feature of zf2 (the pagination) is still broken, or am I missing something? here is my code: <?php namespace Application\Service\User; use Zend\Paginator\Paginator, Zend\Paginator\Adapter\DbSelect as PaginatorDbSelect; ... ... public function getTransactions() { $paginator = new Paginator(new PaginatorDbSelect($this->sqlGateway*->select('user')->where("user_id='{$userId}'"))); $paginator->setItemCountPerPage(5) ->setCurrentPageNumber(1); * sqlGateway is a custom wrapper that wraps all of the select, insert, update, delete and arapter classes in a single class. I'm still getting the following error: Fatal error: Call to undefined method Zend\Db\Sql\Select::__toString() in /****/vendor/zendframework/zendframework/library/Zend/Paginator/Adapter/DbSelect.php on line 154 Please help ![]() |
|
Administrator
|
-- cmple <[hidden email]> wrote
(on Saturday, 04 August 2012, 07:38 PM -0700): > It seems like the most vital feature of zf2 (the pagination) is still > broken, or am I missing something? The DbSelect adapter has known issues, and a couple of contributors are collaborating to get those resolved before the next RC release. > here is my code: > > <?php > namespace Application\Service\User; > > use Zend\Paginator\Paginator, > Zend\Paginator\Adapter\DbSelect as PaginatorDbSelect; > > ... > ... > > public function getTransactions() { > $paginator = new Paginator(new > PaginatorDbSelect($this->sqlGateway*->select('user')->where("user_id='{$userId}'"))); > $paginator->setItemCountPerPage(5) > ->setCurrentPageNumber(1); > > * sqlGateway is a custom wrapper that wraps all of the select, insert, > update, delete and arapter classes in a single class. > > I'm still getting the following error: > > Fatal error: Call to undefined method Zend\Db\Sql\Select::__toString() in > /****/vendor/zendframework/zendframework/library/Zend/Paginator/Adapter/DbSelect.php > on line 154 > > Please help > > > > > > -- > View this message in context: http://zend-framework-community.634137.n4.nabble.com/ZF2-2-0-0rc2-Pagination-is-still-broken-tp4656101.html > Sent from the Zend Framework mailing list archive at Nabble.com. > > -- > List: [hidden email] > Info: http://framework.zend.com/archives > Unsubscribe: [hidden email] > > -- Matthew Weier O'Phinney Project Lead | [hidden email] Zend Framework | http://framework.zend.com/ PGP key: http://framework.zend.com/zf-matthew-pgp-key.asc -- List: [hidden email] Info: http://framework.zend.com/archives Unsubscribe: [hidden email] |
|
use doctrine instead zend db
On Mon, Aug 6, 2012 at 7:46 PM, Matthew Weier O'Phinney <[hidden email]>wrote: > -- cmple <[hidden email]> wrote > (on Saturday, 04 August 2012, 07:38 PM -0700): > > It seems like the most vital feature of zf2 (the pagination) is still > > broken, or am I missing something? > > The DbSelect adapter has known issues, and a couple of contributors are > collaborating to get those resolved before the next RC release. > > > here is my code: > > > > <?php > > namespace Application\Service\User; > > > > use Zend\Paginator\Paginator, > > Zend\Paginator\Adapter\DbSelect as PaginatorDbSelect; > > > > ... > > ... > > > > public function getTransactions() { > > $paginator = new Paginator(new > > > PaginatorDbSelect($this->sqlGateway*->select('user')->where("user_id='{$userId}'"))); > > $paginator->setItemCountPerPage(5) > > ->setCurrentPageNumber(1); > > > > * sqlGateway is a custom wrapper that wraps all of the select, insert, > > update, delete and arapter classes in a single class. > > > > I'm still getting the following error: > > > > Fatal error: Call to undefined method Zend\Db\Sql\Select::__toString() in > > > /****/vendor/zendframework/zendframework/library/Zend/Paginator/Adapter/DbSelect.php > > on line 154 > > > > Please help > > > > > > > > > > > > -- > > View this message in context: > http://zend-framework-community.634137.n4.nabble.com/ZF2-2-0-0rc2-Pagination-is-still-broken-tp4656101.html > > Sent from the Zend Framework mailing list archive at Nabble.com. > > > > -- > > List: [hidden email] > > Info: http://framework.zend.com/archives > > Unsubscribe: [hidden email] > > > > > > -- > Matthew Weier O'Phinney > Project Lead | [hidden email] > Zend Framework | http://framework.zend.com/ > PGP key: http://framework.zend.com/zf-matthew-pgp-key.asc > > -- > List: [hidden email] > Info: http://framework.zend.com/archives > Unsubscribe: [hidden email] > > > -- ________________ Sincerely Sina Miandashti www.InTheMix.ir Admin www.teamatec.com Head PHP Developer |
Hey Sina, Can you provide an example? thanks! |
|
@sina there isn't any adapter for pagination based on the ORM as far as I
know (also: I don't think that is very constructive). Marco Pivetta http://twitter.com/Ocramius http://marco-pivetta.com On 8 August 2012 09:03, cmple <[hidden email]> wrote: > > sina miandashti wrote > > > > use doctrine instead zend db > > > > On Mon, Aug 6, 2012 at 7:46 PM, Matthew Weier O'Phinney > > <matthew@>wrote: > > > >> -- cmple <roman.vidyayev@> wrote > >> (on Saturday, 04 August 2012, 07:38 PM -0700): > >> > It seems like the most vital feature of zf2 (the pagination) is still > >> > broken, or am I missing something? > >> > >> The DbSelect adapter has known issues, and a couple of contributors are > >> collaborating to get those resolved before the next RC release. > >> > >> > here is my code: > >> > > >> > <?php > >> > namespace Application\Service\User; > >> > > >> > use Zend\Paginator\Paginator, > >> > Zend\Paginator\Adapter\DbSelect as PaginatorDbSelect; > >> > > >> > ... > >> > ... > >> > > >> > public function getTransactions() { > >> > $paginator = new Paginator(new > >> > > >> > PaginatorDbSelect($this->sqlGateway*->select('user')->where("user_id='{$userId}'"))); > >> > $paginator->setItemCountPerPage(5) > >> > ->setCurrentPageNumber(1); > >> > > >> > * sqlGateway is a custom wrapper that wraps all of the select, insert, > >> > update, delete and arapter classes in a single class. > >> > > >> > I'm still getting the following error: > >> > > >> > Fatal error: Call to undefined method Zend\Db\Sql\Select::__toString() > >> in > >> > > >> > /****/vendor/zendframework/zendframework/library/Zend/Paginator/Adapter/DbSelect.php > >> > on line 154 > >> > > >> > Please help > >> > > >> > > >> > > >> > > >> > > >> > -- > >> > View this message in context: > >> > http://zend-framework-community.634137.n4.nabble.com/ZF2-2-0-0rc2-Pagination-is-still-broken-tp4656101.html > >> > Sent from the Zend Framework mailing list archive at Nabble.com. > >> > > >> > -- > >> > List: fw-general@.zend > >> > Info: http://framework.zend.com/archives > >> > Unsubscribe: fw-general-unsubscribe@.zend > >> > > >> > > >> > >> -- > >> Matthew Weier O'Phinney > >> Project Lead | matthew@ > >> Zend Framework | http://framework.zend.com/ > >> PGP key: http://framework.zend.com/zf-matthew-pgp-key.asc > >> > >> -- > >> List: fw-general@.zend > >> Info: http://framework.zend.com/archives > >> Unsubscribe: fw-general-unsubscribe@.zend > >> > >> > >> > > > > > > -- > > ________________ > > Sincerely > > Sina Miandashti > > www.InTheMix.ir Admin > > www.teamatec.com Head PHP Developer > > > > Hey Sina, > Can you provide an example? > thanks! > > > > -- > View this message in context: > http://zend-framework-community.634137.n4.nabble.com/ZF2-2-0-0rc2-Pagination-is-still-broken-tp4656101p4656142.html > Sent from the Zend Framework mailing list archive at Nabble.com. > > -- > List: [hidden email] > Info: http://framework.zend.com/archives > Unsubscribe: [hidden email] > > > |
|
@marco
writing adapter for doctrine was really easy for zf1 i dont thinks its hard to do it on zf2 @cmpl learn doctrine orm and doctrine orm query builder @ official doctrine website http://docs.doctrine-project.org/ install doctrine orm module https://github.com/doctrine/DoctrineORMModule start querying with doctrine query builder send the query to your paginator adapter for doctrine here is what i done for zf1 paginator adapter: https://gist.github.com/3308761 here is usage example https://gist.github.com/3308783 On Wed, Aug 8, 2012 at 12:10 PM, Marco Pivetta <[hidden email]> wrote: > @sina there isn't any adapter for pagination based on the ORM as far as I > know (also: I don't think that is very constructive). > > Marco Pivetta > > http://twitter.com/Ocramius > > http://marco-pivetta.com > > > > On 8 August 2012 09:03, cmple <[hidden email]> wrote: > > > > > sina miandashti wrote > > > > > > use doctrine instead zend db > > > > > > On Mon, Aug 6, 2012 at 7:46 PM, Matthew Weier O'Phinney > > > <matthew@>wrote: > > > > > >> -- cmple <roman.vidyayev@> wrote > > >> (on Saturday, 04 August 2012, 07:38 PM -0700): > > >> > It seems like the most vital feature of zf2 (the pagination) is > still > > >> > broken, or am I missing something? > > >> > > >> The DbSelect adapter has known issues, and a couple of contributors > are > > >> collaborating to get those resolved before the next RC release. > > >> > > >> > here is my code: > > >> > > > >> > <?php > > >> > namespace Application\Service\User; > > >> > > > >> > use Zend\Paginator\Paginator, > > >> > Zend\Paginator\Adapter\DbSelect as PaginatorDbSelect; > > >> > > > >> > ... > > >> > ... > > >> > > > >> > public function getTransactions() { > > >> > $paginator = new Paginator(new > > >> > > > >> > > > PaginatorDbSelect($this->sqlGateway*->select('user')->where("user_id='{$userId}'"))); > > >> > $paginator->setItemCountPerPage(5) > > >> > ->setCurrentPageNumber(1); > > >> > > > >> > * sqlGateway is a custom wrapper that wraps all of the select, > insert, > > >> > update, delete and arapter classes in a single class. > > >> > > > >> > I'm still getting the following error: > > >> > > > >> > Fatal error: Call to undefined method > Zend\Db\Sql\Select::__toString() > > >> in > > >> > > > >> > > > /****/vendor/zendframework/zendframework/library/Zend/Paginator/Adapter/DbSelect.php > > >> > on line 154 > > >> > > > >> > Please help > > >> > > > >> > > > >> > > > >> > > > >> > > > >> > -- > > >> > View this message in context: > > >> > > > http://zend-framework-community.634137.n4.nabble.com/ZF2-2-0-0rc2-Pagination-is-still-broken-tp4656101.html > > >> > Sent from the Zend Framework mailing list archive at Nabble.com. > > >> > > > >> > -- > > >> > List: fw-general@.zend > > >> > Info: http://framework.zend.com/archives > > >> > Unsubscribe: fw-general-unsubscribe@.zend > > >> > > > >> > > > >> > > >> -- > > >> Matthew Weier O'Phinney > > >> Project Lead | matthew@ > > >> Zend Framework | http://framework.zend.com/ > > >> PGP key: http://framework.zend.com/zf-matthew-pgp-key.asc > > >> > > >> -- > > >> List: fw-general@.zend > > >> Info: http://framework.zend.com/archives > > >> Unsubscribe: fw-general-unsubscribe@.zend > > >> > > >> > > >> > > > > > > > > > -- > > > ________________ > > > Sincerely > > > Sina Miandashti > > > www.InTheMix.ir Admin > > > www.teamatec.com Head PHP Developer > > > > > > > Hey Sina, > > Can you provide an example? > > thanks! > > > > > > > > -- > > View this message in context: > > > http://zend-framework-community.634137.n4.nabble.com/ZF2-2-0-0rc2-Pagination-is-still-broken-tp4656101p4656142.html > > Sent from the Zend Framework mailing list archive at Nabble.com. > > > > -- > > List: [hidden email] > > Info: http://framework.zend.com/archives > > Unsubscribe: [hidden email] > > > > > > > -- ________________ Sincerely Sina Miandashti www.InTheMix.ir Admin www.teamatec.com Head PHP Developer |
|
In fact I and Tonis already wrote one:
https://github.com/doctrine/DoctrineORMModule/blob/master/src/DoctrineORMModule/Paginator/Adapter/DoctrinePaginator.php Still no good reason to just say "use doctrine" :) Marco Pivetta http://twitter.com/Ocramius http://marco-pivetta.com On 10 August 2012 00:52, sina miandashti <[hidden email]> wrote: > @marco > > writing adapter for doctrine was really easy for zf1 > > i dont thinks its hard to do it on zf2 > > @cmpl > > learn doctrine orm and doctrine orm query builder @ official doctrine > website http://docs.doctrine-project.org/ > > install doctrine orm module https://github.com/doctrine/DoctrineORMModule > > start querying with doctrine query builder > > send the query to your paginator adapter for doctrine > > here is what i done for zf1 paginator adapter: > > https://gist.github.com/3308761 > > here is usage example > > https://gist.github.com/3308783 > > > > On Wed, Aug 8, 2012 at 12:10 PM, Marco Pivetta <[hidden email]> wrote: > >> @sina there isn't any adapter for pagination based on the ORM as far as I >> know (also: I don't think that is very constructive). >> >> Marco Pivetta >> >> http://twitter.com/Ocramius >> >> http://marco-pivetta.com >> >> >> >> On 8 August 2012 09:03, cmple <[hidden email]> wrote: >> >> > >> > sina miandashti wrote >> > > >> > > use doctrine instead zend db >> > > >> > > On Mon, Aug 6, 2012 at 7:46 PM, Matthew Weier O'Phinney >> > > <matthew@>wrote: >> > > >> > >> -- cmple <roman.vidyayev@> wrote >> > >> (on Saturday, 04 August 2012, 07:38 PM -0700): >> > >> > It seems like the most vital feature of zf2 (the pagination) is >> still >> > >> > broken, or am I missing something? >> > >> >> > >> The DbSelect adapter has known issues, and a couple of contributors >> are >> > >> collaborating to get those resolved before the next RC release. >> > >> >> > >> > here is my code: >> > >> > >> > >> > <?php >> > >> > namespace Application\Service\User; >> > >> > >> > >> > use Zend\Paginator\Paginator, >> > >> > Zend\Paginator\Adapter\DbSelect as PaginatorDbSelect; >> > >> > >> > >> > ... >> > >> > ... >> > >> > >> > >> > public function getTransactions() { >> > >> > $paginator = new Paginator(new >> > >> > >> > >> >> > >> PaginatorDbSelect($this->sqlGateway*->select('user')->where("user_id='{$userId}'"))); >> > >> > $paginator->setItemCountPerPage(5) >> > >> > ->setCurrentPageNumber(1); >> > >> > >> > >> > * sqlGateway is a custom wrapper that wraps all of the select, >> insert, >> > >> > update, delete and arapter classes in a single class. >> > >> > >> > >> > I'm still getting the following error: >> > >> > >> > >> > Fatal error: Call to undefined method >> Zend\Db\Sql\Select::__toString() >> > >> in >> > >> > >> > >> >> > >> /****/vendor/zendframework/zendframework/library/Zend/Paginator/Adapter/DbSelect.php >> > >> > on line 154 >> > >> > >> > >> > Please help >> > >> > >> > >> > >> > >> > >> > >> > >> > >> > >> > >> > -- >> > >> > View this message in context: >> > >> >> > >> http://zend-framework-community.634137.n4.nabble.com/ZF2-2-0-0rc2-Pagination-is-still-broken-tp4656101.html >> > >> > Sent from the Zend Framework mailing list archive at Nabble.com. >> > >> > >> > >> > -- >> > >> > List: fw-general@.zend >> > >> > Info: http://framework.zend.com/archives >> > >> > Unsubscribe: fw-general-unsubscribe@.zend >> > >> > >> > >> > >> > >> >> > >> -- >> > >> Matthew Weier O'Phinney >> > >> Project Lead | matthew@ >> > >> Zend Framework | http://framework.zend.com/ >> > >> PGP key: http://framework.zend.com/zf-matthew-pgp-key.asc >> > >> >> > >> -- >> > >> List: fw-general@.zend >> > >> Info: http://framework.zend.com/archives >> > >> Unsubscribe: fw-general-unsubscribe@.zend >> > >> >> > >> >> > >> >> > > >> > > >> > > -- >> > > ________________ >> > > Sincerely >> > > Sina Miandashti >> > > www.InTheMix.ir Admin >> > > www.teamatec.com Head PHP Developer >> > > >> > >> > Hey Sina, >> > Can you provide an example? >> > thanks! >> > >> > >> > >> > -- >> > View this message in context: >> > >> http://zend-framework-community.634137.n4.nabble.com/ZF2-2-0-0rc2-Pagination-is-still-broken-tp4656101p4656142.html >> > Sent from the Zend Framework mailing list archive at Nabble.com. >> > >> > -- >> > List: [hidden email] >> > Info: http://framework.zend.com/archives >> > Unsubscribe: [hidden email] >> > >> > >> > >> > > > > -- > ________________ > Sincerely > Sina Miandashti > www.InTheMix.ir Admin > www.teamatec.com Head PHP Developer > |
|
ok
thanks cau please provide example of usage On Fri, Aug 10, 2012 at 3:50 AM, Marco Pivetta <[hidden email]> wrote: > In fact I and Tonis already wrote one: > https://github.com/doctrine/DoctrineORMModule/blob/master/src/DoctrineORMModule/Paginator/Adapter/DoctrinePaginator.php > > Still no good reason to just say "use doctrine" :) > > > Marco Pivetta > > http://twitter.com/Ocramius > > http://marco-pivetta.com > > > > On 10 August 2012 00:52, sina miandashti <[hidden email]> wrote: > >> @marco >> >> writing adapter for doctrine was really easy for zf1 >> >> i dont thinks its hard to do it on zf2 >> >> @cmpl >> >> learn doctrine orm and doctrine orm query builder @ official doctrine >> website http://docs.doctrine-project.org/ >> >> install doctrine orm module https://github.com/doctrine/DoctrineORMModule >> >> start querying with doctrine query builder >> >> send the query to your paginator adapter for doctrine >> >> here is what i done for zf1 paginator adapter: >> >> https://gist.github.com/3308761 >> >> here is usage example >> >> https://gist.github.com/3308783 >> >> >> >> On Wed, Aug 8, 2012 at 12:10 PM, Marco Pivetta <[hidden email]>wrote: >> >>> @sina there isn't any adapter for pagination based on the ORM as far as I >>> know (also: I don't think that is very constructive). >>> >>> Marco Pivetta >>> >>> http://twitter.com/Ocramius >>> >>> http://marco-pivetta.com >>> >>> >>> >>> On 8 August 2012 09:03, cmple <[hidden email]> wrote: >>> >>> > >>> > sina miandashti wrote >>> > > >>> > > use doctrine instead zend db >>> > > >>> > > On Mon, Aug 6, 2012 at 7:46 PM, Matthew Weier O'Phinney >>> > > <matthew@>wrote: >>> > > >>> > >> -- cmple <roman.vidyayev@> wrote >>> > >> (on Saturday, 04 August 2012, 07:38 PM -0700): >>> > >> > It seems like the most vital feature of zf2 (the pagination) is >>> still >>> > >> > broken, or am I missing something? >>> > >> >>> > >> The DbSelect adapter has known issues, and a couple of contributors >>> are >>> > >> collaborating to get those resolved before the next RC release. >>> > >> >>> > >> > here is my code: >>> > >> > >>> > >> > <?php >>> > >> > namespace Application\Service\User; >>> > >> > >>> > >> > use Zend\Paginator\Paginator, >>> > >> > Zend\Paginator\Adapter\DbSelect as PaginatorDbSelect; >>> > >> > >>> > >> > ... >>> > >> > ... >>> > >> > >>> > >> > public function getTransactions() { >>> > >> > $paginator = new Paginator(new >>> > >> > >>> > >> >>> > >>> PaginatorDbSelect($this->sqlGateway*->select('user')->where("user_id='{$userId}'"))); >>> > >> > $paginator->setItemCountPerPage(5) >>> > >> > ->setCurrentPageNumber(1); >>> > >> > >>> > >> > * sqlGateway is a custom wrapper that wraps all of the select, >>> insert, >>> > >> > update, delete and arapter classes in a single class. >>> > >> > >>> > >> > I'm still getting the following error: >>> > >> > >>> > >> > Fatal error: Call to undefined method >>> Zend\Db\Sql\Select::__toString() >>> > >> in >>> > >> > >>> > >> >>> > >>> /****/vendor/zendframework/zendframework/library/Zend/Paginator/Adapter/DbSelect.php >>> > >> > on line 154 >>> > >> > >>> > >> > Please help >>> > >> > >>> > >> > >>> > >> > >>> > >> > >>> > >> > >>> > >> > -- >>> > >> > View this message in context: >>> > >> >>> > >>> http://zend-framework-community.634137.n4.nabble.com/ZF2-2-0-0rc2-Pagination-is-still-broken-tp4656101.html >>> > >> > Sent from the Zend Framework mailing list archive at Nabble.com. >>> > >> > >>> > >> > -- >>> > >> > List: fw-general@.zend >>> > >> > Info: http://framework.zend.com/archives >>> > >> > Unsubscribe: fw-general-unsubscribe@.zend >>> > >> > >>> > >> > >>> > >> >>> > >> -- >>> > >> Matthew Weier O'Phinney >>> > >> Project Lead | matthew@ >>> > >> Zend Framework | http://framework.zend.com/ >>> > >> PGP key: http://framework.zend.com/zf-matthew-pgp-key.asc >>> > >> >>> > >> -- >>> > >> List: fw-general@.zend >>> > >> Info: http://framework.zend.com/archives >>> > >> Unsubscribe: fw-general-unsubscribe@.zend >>> > >> >>> > >> >>> > >> >>> > > >>> > > >>> > > -- >>> > > ________________ >>> > > Sincerely >>> > > Sina Miandashti >>> > > www.InTheMix.ir Admin >>> > > www.teamatec.com Head PHP Developer >>> > > >>> > >>> > Hey Sina, >>> > Can you provide an example? >>> > thanks! >>> > >>> > >>> > >>> > -- >>> > View this message in context: >>> > >>> http://zend-framework-community.634137.n4.nabble.com/ZF2-2-0-0rc2-Pagination-is-still-broken-tp4656101p4656142.html >>> > Sent from the Zend Framework mailing list archive at Nabble.com. >>> > >>> > -- >>> > List: [hidden email] >>> > Info: http://framework.zend.com/archives >>> > Unsubscribe: [hidden email] >>> > >>> > >>> > >>> >> >> >> >> -- >> ________________ >> Sincerely >> Sina Miandashti >> www.InTheMix.ir Admin >> www.teamatec.com Head PHP Developer >> > > -- ________________ Sincerely Sina Miandashti www.InTheMix.ir Admin www.teamatec.com Head PHP Developer |
|
In reply to this post by sina miandashti
Speed is also a concern here, I was hesitant of creating an "Admin" module within the same app just for the sake of speed, but creating a separate module with all those files just for pagination seems like overkill to me |
| Powered by Nabble | Edit this page |
