Love Fuel?    Donate

FuelPHP Forums

Ask your question about FuelPHP in the appropriate forum, or help others by answering their questions.
How could I ignore some columns When I saving posts by ORM
  • ORM will insert all columns default from $_properties.

    But in some cases  I don't want to automatic  insert  to `null` value that I have not point into the form.

    Is any way I  could ignore it?
  • HarroHarro
    Accepted Answer
    Give the column a default value in the properties.

    The ORM always uses all columns, it doesn't rely on RDBMS features to fill in missing columns (like MySQL's default value on a column), since some don't support such a feature.

    So don't use defaults in the DB, define the defaults in the model.
  • Interesting point, I think I have to change some controllers ...

Howdy, Stranger!

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

In this Discussion