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

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.

主站蜘蛛池模板: 闻喜县| 九台市| 汶上县| 兴文县| 芜湖县| 方正县| 太白县| 宁陕县| 湖口县| 石门县| 石嘴山市| 东阳市| 南阳市| 梅河口市| 开江县| 铜川市| 墨竹工卡县| 无棣县| 赣榆县| 阿坝| 开远市| 麟游县| 宜兴市| 武汉市| 房山区| 广安市| 汝阳县| 逊克县| 江华| 津市市| 西城区| 冷水江市| 新巴尔虎左旗| 通化市| 鸡泽县| 顺昌县| 攀枝花市| 肃北| 郯城县| 房产| 本溪|