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

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.

主站蜘蛛池模板: 黄骅市| 凉城县| 靖西县| 乌拉特后旗| 道真| 永清县| 唐河县| 栾川县| 双流县| 敦化市| 安顺市| 卢龙县| 梅河口市| 呼玛县| 新安县| 尉氏县| 镇雄县| 卢龙县| 板桥市| 四平市| 韶关市| 廊坊市| 贺兰县| 库伦旗| 清流县| 岱山县| 革吉县| 措勤县| 武宁县| 盐城市| 勐海县| 定日县| 永仁县| 镇巴县| 穆棱市| 宾阳县| 调兵山市| 东乡族自治县| 宾川县| 尤溪县| 大连市|