jonathangeiger / kohana-jelly

See the link below for the most up-to-date code
https://github.com/creatoro/jelly
MIT License
146 stars 34 forks source link

conditions in the collections #115

Closed ginad closed 14 years ago

ginad commented 14 years ago

I have a model author and has many posts is it possible to do:

$a = Jelly::select("author");
// is this possible
$a->where("type","=","general")->posts;
// or 
$a->posts->where("type","=","general");
// or user ordery_by
$a->posts->order_by("id","DESC")

Thanks

smgladkovskiy commented 14 years ago

try this

$a->get('posts')->where('type', '=', 'general')->order_by('id', 'DESC')->execute();
smgladkovskiy commented 14 years ago

I think that it is preferred to ask such questions on the Jelly Forum: http://dev.kohanaframework.org/projects/jelly/boards

banks commented 14 years ago

Correct answer above, general questions should be in the forums rather than here.