Love Fuel?    Donate

FuelPHP Forums

Ask your question about FuelPHP in the appropriate forum, or help others by answering their questions.
Orm\Observer_Typing with Model::query()->get()
  • I was encountered with time wasting problem working with Orm query. Some of Model queries are fast enough, but one Model query is too slow. I tried to inspect where we waste the time and what difference between that one Model and any others. I found in that Model Orm\Observer_Typing is set and when I commented out this element I won up to 4 seconds on that query!

    I thought the type casting acts only when Model saving, but now I execute some query()->get() (with some relations and where conditions). So it's reading operation. Why does type casting act here? Is it a bug?

    Thank you.
  • No, typing is bi-directional.

    This suggests you are doing bulk operations using the ORM, which isn't really suited for that, because of this, but also because the hydrating process and the fact all ORM objects are cached (i.e. kept in memory).
  • Ok, thank you for answer. It's useful to know.
  • The idea behind it is that you can use it to convert a serialized array to an array on read, and serialize it again on write. Or an integer (which some drivers return as string) to an integer and back.

Howdy, Stranger!

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

In this Discussion