官术网_书友最值得收藏!

Chapter 2. Model Bindings

In this chapter, we will cover:

  • Adding Containable to all models
  • Limiting the bindings returned in a find
  • Modifying binding parameters for a find
  • Modifying binding conditions for a find
  • Changing the JOIN type of one-to-one associations
  • Defining multiple associations to the same model
  • Adding bindings on the fly

Introduction

This chapter deals with one of the most important aspects of a CakePHP application: the relationship between models, also known as model bindings or associations.

Being an integral part of any application's logic, it is of crucial importance that we master all aspects of how model bindings can be manipulated to get the data we need, when we need it.

In order to do so, we will go through a series of recipes that will show us how to change the way bindings are fetched, what bindings and what information from a binding is returned, how to create new bindings, and how to build hierarchical data structures.

主站蜘蛛池模板: 镇康县| 白河县| 壶关县| 大荔县| 观塘区| 宕昌县| 平南县| 涟水县| 晋中市| 句容市| 米林县| 荆州市| 丹东市| 博乐市| 泰安市| 杂多县| 含山县| 贵州省| 胶州市| 黎平县| 扎赉特旗| 江油市| 海晏县| 综艺| 哈巴河县| 肥乡县| 嘉祥县| 会泽县| 青河县| 诏安县| 荔浦县| 建水县| 罗平县| 拜城县| 临夏县| 阿克苏市| 兴隆县| 天镇县| 沿河| 清远市| 衡南县|