Skip to content

Commit

Permalink
Merge pull request cfwheels#1344 from MvdO79/MvdO79-patch-11
Browse files Browse the repository at this point in the history
Update object-relational-mapping.md
  • Loading branch information
bpamiri authored Nov 13, 2023
2 parents 99e4c4c + dc086ab commit 9b7408a
Showing 1 changed file with 9 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -104,7 +104,15 @@ function config() {

With that in place, you have the foundation for a model that never touches the database. When you call methods like [save()](https://api.cfwheels.org/model.save.html), [create()](https://api.cfwheels.org/model.create.html), [update()](https://api.cfwheels.org/model.update.html), and [delete()](https://api.cfwheels.org/model.delete.html) on a tableless model, the entire model lifecycle will still run, including object validation and object callbacks.

Typically, you will want to configure properties and validations manually for tableless models and then override [save()](https://api.cfwheels.org/model.save.html)and other persistence methods needed by your application to persist with the data elsewhere (maybe in the `session`scope, an external NoSQL database, or as an email sent from a contact form).
Typically, you will want to configure properties and validations manually for tableless models and then override [save()](https://api.cfwheels.org/model.save.html) and other persistence methods needed by your application to persist with the data elsewhere (maybe in the `session` scope, an external NoSQL database, or as an email sent from a contact form).

Features supported:

- Properties
- Validations
- Callbacks involving initialisation and validations

See [Building search forms with tableless models in CFWheels](https://cfwheels.org/blog/building-search-forms-with-tableless-models-in-cfwheels) for a worked-out example.

### Columns and Properties

Expand Down

0 comments on commit 9b7408a

Please sign in to comment.