finderQuery Parameter

To produce even more customized results, you may enter a SQL string in the finderOuery key, and it will run when the associated records are queried. You really should need to use this option only if your application requires a high level of database customization. Most of the time, you will be able to work just fine using Cake's built-in model functions.

The "has many" relationship is extremely useful for helping to design effective databases. If you know that you intend to put a select menu in your application for a series of options that will be stored in the database, the "has many" relationship can help you do so without writing a static list in HTML. Instead, you could build a table to store those options and associate them through the models using a "has many" relationship. Then, no matter what may happen with feature creep or with adding or deleting options from the list, you can rest assured the application isn't broken and can handle the changes. It's built on a database, not on static forms, meaning that the application is dynamic and can change easily.

0 0

Post a comment

  • Receive news updates via email from this site