Code Monkey home page Code Monkey logo

Comments (15)

fprochazka avatar fprochazka commented on September 18, 2024

Can Paginator handle NativeQuery?

from doctrine.

stekycz avatar stekycz commented on September 18, 2024

It does not. Lets look at ResultSet which accepts AbstractQuery in constructor. I think it is just typo in your code. However there can be some easier QueryObject which could implements subset of current methods. Don`t you think?

from doctrine.

fprochazka avatar fprochazka commented on September 18, 2024

The whole point of result set is to paginate the result, and if you pass me a native query, I have no idea ho to count the total number of rows it will return.

from doctrine.

Majkl578 avatar Majkl578 commented on September 18, 2024

Sadly, I failed as well to use QueryObjects for native queries.

from doctrine.

stekycz avatar stekycz commented on September 18, 2024

Well, ok. However there could be at least interface/abstract class which I can extend and then use it in similar way as QueryObject. Current QueryObject can use this class as well. I want to call

$result = $dao->fetch(new AwesomeNativeQuery());

The result can be then an array. The other way is to add another method to EntityDao (eg. fetchNative).

from doctrine.

stekycz avatar stekycz commented on September 18, 2024

Fuck, bad button.

from doctrine.

fprochazka avatar fprochazka commented on September 18, 2024

This dould be doable, if there would be optional method countNativeQuery in the query object, that you would have to implement to bypass the total count problem.

from doctrine.

Majkl578 avatar Majkl578 commented on September 18, 2024

Total count by subselect would not be a problem.

from doctrine.

fprochazka avatar fprochazka commented on September 18, 2024

Are you sure that is a good idea?

from doctrine.

Majkl578 avatar Majkl578 commented on September 18, 2024

Well, not universally, since sometimes you have 1:N joins. :|

from doctrine.

stekycz avatar stekycz commented on September 18, 2024

I agree with @Majkl578 - Doctrine do it itself in Paginator.

from doctrine.

fprochazka avatar fprochazka commented on September 18, 2024

Would you guys give it a try please?

from doctrine.

stekycz avatar stekycz commented on September 18, 2024

It shouldn't be closed, right?

from doctrine.

fprochazka avatar fprochazka commented on September 18, 2024

Well, I've tested it and it worked, so why not?

from doctrine.

stekycz avatar stekycz commented on September 18, 2024

I thought it is in some pull request at first. I must agree now :-)

from doctrine.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.