Giter Site home page Giter Site logo

kohana-paginate's People

Contributors

morgan avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

kohana-paginate's Issues

Paginate with collections

Hi,

This is a question rather than a bugs :)

With kohana-paginate, can I do something like this ( get all posts with 'news' tag)?

$tag = ORM::factory('tag', 5); // news tag
$articles = $tag->articles; // articles with news' tag

$paginate = Paginate::factory($articles);

I try the above code, but didn't work

Thanks.

GROUP BY CASE issue

Hi and sorry to bother you again :)

I'm trying to use paginate with this query :

$products = DB::query(Database::SELECT, '
            SELECT * FROM shop_products
            GROUP BY CASE configurable 
            WHEN 1 THEN configuration_id
            ELSE id 
            END
        ')->as_object('Model_Product');

I have to go through a manual query because ORM does not support the group by case condition.

The thing is, DB::query() returns a Database_Query object which (logically) does not implement the order_by() and the offset() functions, so I'm getting this error : Call to undefined method Database_Query::order_by() in /modules/paginate/classes/Kohana/Paginate/Database.php on line 64

Would you have an idea to work around this problem? Right now the only way I can see this working, is to actually write a group_by_case function for the database query builder class, but I thought you might have another idea...?

Adding a where condition

Hi,

Is it possible to add a ->where('col','=','something') ORM condition to a paginate object ?

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.