Love Fuel?    Donate

FuelPHP Forums

Ask your question about FuelPHP in the appropriate forum, or help others by answering their questions.
Using DB::expr with ORM related queries
  • I have a query with ORM that is also querying a related object, which is called "base". So I have $class::query()->related('base')->etc. I want to add a condition, where(\DB::expr('DATE(`base`.`created`)'), $date_variable), but ORM aliases the tables and columns so that I can "guess" by doing DATE(t1.c3), but it has the potential to break whenever I add a column to the database. Is there any way of using DB::expr and use the relation name and column name without the aliases?
  • At th moment there isn't.

    Can you create a feature request for it at http://github.com/fuel/orm/issues, with your use case, so it can be picked up?

Howdy, Stranger!

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

In this Discussion