although I am pretty decent at PHP I am new to frameworks. started with CI last week and found myself looking at Kohana this week. I have few questions to that regard:
- why ORM vs traditional SQL or active queries?
- if the model must fetch data from DB , how come in ORM most of the action happens in the controller ( or so it seems ) ie (
$data=$q->where('category', '=', 'articles')->find_all();} - how would I do a conditional query in ORM? ( something like if (isset($_GET['category']))...etc ) if the condition is passed to the model? or should the controller do all the conditions
FYI my queries tend to have numerous joins and my limited knowledge tells me that I should have a query controller that passes queries parameters to a query model which does the query and returns results. Please let me know if my understanding is correct thank you very much