Love Fuel?    Donate

FuelPHP Forums

Ask your question about FuelPHP in the appropriate forum, or help others by answering their questions.
some doubts
  • how to print sql query ? how to use related with modules? Related model not found by Belongs_To ... Thank YOu
  • forgot how to use "and where" and "or where" ? Sorry My english!!
  • If your related model is in a different namespace, you have to define it in the relation fully namespaced, minus the leading backslash.
    'model_to' => 'Module\\Model_Name',
    

    If you want the see SQL being executed, you can activate the profiler (global setting in app/config/config.php, enable db profiling in your db.php). If you want it in code, you can use the get_query() method at the end of the chain ( instead of get() or get_one() ).
  • very good Thank you! You know how to do "or where" in a related model? I wanted to put a condition "where" the main model but "or_where" related to the same time .. related => array ('or_where' ....) # does not work
  • As far as I can see in the code, conditions do not support 'or_where'. at the moment. You can create a feature request for that if you want: https://github.com/fuel/orm/issues, no guarantees it will be picked up though.

Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

In this Discussion