How would I change this Query builder from Kohana 2.4 to Kohana 3?

Posted by Thorpe Obazee on Stack Overflow See other posts from Stack Overflow or by Thorpe Obazee
Published on 2011-01-11T11:56:36Z Indexed on 2011/01/11 12:53 UTC
Read the original article Hit count: 269

Filed under:
|

I have had this website built for a few months and I am just getting on Kohana 3. I'd just like to convert this K2.4 query builder to K3 query builder.

return DB::select(array('posts.id', 'posts.created', 'posts.uri', 'posts.price', 'posts.description', 'posts.title',
                'image_count' => db::expr('COUNT(images.id)')))
        ->from('posts')
        ->join('images')->on('images.post_id', '=', 'posts.id')
        ->group_by(array('posts.id'))
        ->order_by('posts.id', 'DESC')
        ->limit($limit)
        ->offset($offset)
        ->execute();

© Stack Overflow or respective owner

Related posts about kohana

Related posts about kohana-3