$ open source · GPL-3.0 — need a commercial license? imqueue.com →

BaseModel.fixNumbers() method

Casts this instance's numeric columns back to numbers.

Signature:

fixNumbers(): BaseModel<T>;

Returns:

BaseModel<T>

This instance, for chaining.

Remarks

Numeric columns selected through a view arrive as strings, so the finders on this class re-cast them after every select on a view, and this is the method they use. It is public for the cases they do not cover, a raw query being the common one.

Only the columns the model declares are looked at, and the instance is changed in place.