CakePHP Cookbook 3.x
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 351 12 Database Access & ORM 463 Quick Example . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . “Comment”, or “Photo”. If we wanted to load some data from our users table we could do: use Cake\ORM\TableRegistry; (continues on next page) 1 CakePHP Cookbook Documentation, Release 3.10 (continued If we wanted to make a new user and save it (with validation) we would do something like: use Cake\ORM\TableRegistry; // Prior to 3.6 use TableRegistry::get('Users') $users = TableRegistry::getTableLo0 码力 | 967 页 | 2.80 MB | 1 年前3CakePHP Cookbook Documentation 5.x
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 219 12 Database Access & ORM 321 Quick Example . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . “Comment”, or “Photo”. If we wanted to load some data from our users table we could do: use Cake\ORM\Locator\LocatorAwareTrait; (continues on next page) 1 CakePHP Cookbook Documentation, Release 5 If we wanted to make a new user and save it (with validation) we would do something like: use Cake\ORM\Locator\LocatorAwareTrait; $users = $this->getTableLocator()->get('Users'); $user = $users->newEntity(['email'0 码力 | 848 页 | 2.53 MB | 1 年前3CakePHP Cookbook 4.x
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 317 12 Database Access & ORM 419 Quick Example . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . “Comment”, or “Photo”. If we wanted to load some data from our users table we could do: use Cake\ORM\Locator\LocatorAwareTrait; (continues on next page) 1 CakePHP Cookbook Documentation, Release 4 If we wanted to make a new user and save it (with validation) we would do something like: use Cake\ORM\Locator\LocatorAwareTrait; $users = $this->getTableLocator()->get('Users'); $user = $users->newEntity(['email'0 码力 | 967 页 | 2.88 MB | 1 年前3CakePHP Cookbook 3.x
Migration Guide 3.1 Migration Guide 3.1 Migration Guide 3.0 Migration Guide 3.0 Migration Guide New ORM Upgrade Guide Tutorials & Examples Content Management Tutorial Getting CakePHP Checking our Installation Own View Classes More About Views View Cells Themes JSON and XML views Helpers Database Access & ORM Quick Example More Information Database Basics Query Builder Table Objects Entities Retrieving Data “Comment”, or “Photo”. If we wanted to load some data from our users table we could do: use Cake\ORM\TableRegistry; // Prior to 3.6 use TableRegistry::get('Users') $users = TableRegistry::getTableLo0 码力 | 1244 页 | 1.05 MB | 1 年前3CakePHP Cookbook 4.x
Own View Classes More About Views View Cells Themes JSON and XML views Helpers Database Access & ORM Quick Example More Information Database Basics Query Builder Table Objects Entities Retrieving Data “Comment”, or “Photo”. If we wanted to load some data from our users table we could do: use Cake\ORM\Locator\LocatorAwareTrait; $users = $this->getTableLocator()->get('Users'); $resultset = $users->find()->all(); If we wanted to make a new user and save it (with validation) we would do something like: use Cake\ORM\Locator\LocatorAwareTrait; $users = $this->getTableLocator()->get('Users'); $user = $users->newEntity(['email'0 码力 | 1249 页 | 1.04 MB | 1 年前3CakePHP Cookbook Documentation 5.x
Own View Classes More About Views View Cells Themes JSON and XML views Helpers Database Access & ORM Quick Example More Information Database Basics Query Builder Table Objects Entities Retrieving Data “Comment”, or “Photo”. If we wanted to load some data from our users table we could do: use Cake\ORM\Locator\LocatorAwareTrait; $users = $this->getTableLocator()->get('Users'); $resultset = $users->find()->all(); If we wanted to make a new user and save it (with validation) we would do something like: use Cake\ORM\Locator\LocatorAwareTrait; $users = $this->getTableLocator()->get('Users'); $user = $users->newEntity(['email'0 码力 | 1080 页 | 939.39 KB | 1 年前3《Slides Dev Web》02. Introduction aux frameworks PHP
org/web/20160316065751/http://blog.mazenod.fr/2010/01/design-pattern-mvc-zoom-sur-la- couche-modele-dal-dao-orm-crud/ 6http://ui-patterns.com/ 2 Figure 1: MVC 3 Bonnes pratiques • Heavy Model, Light Controller code qu’une appli standalone – Plus de requêtes • Solutions – Cache de pages, d’opcode – Jointures ORM, vues, procédures stockées – Outils d’optimisation : YSlow, page speed, mytop 6 Frameworks PHP • réelle de notre base de données et offrir une interface orientée objet. Un Object-Relational Mapping ou ORM(3) dans le jargon. query( "SELECT * FROM `personnes` ". "WHERE0 码力 | 24 页 | 1.03 MB | 1 年前3CmlPHP v2.x 开发手册
获取列表 1.6.6.15.6 7. 注意事项 1.6.6.15.7 16. 同时查询多个库 1.6.6.16 7. 模型-MongoDB 1.6.7 1. Orm详细Api 1.6.7.1 8. 服务 1.6.8 9. 视图 1.6.9 1. 统一的API 1.6.9.1 2. Html模板引擎 1.6.9.2 \Cml\Http\Session::delete($name); 清空session \Cml\Http\Session::clear($name); 模型[mysql] 本 小 节 介 绍 常 用 的 orm mysql 操 作 。 详 细 的 api 点这里 模型全部存放在应用路径下 的 Model 目 录 ( 可 自 定 义 只 是 建 议 命 名 为 Model) 中 , 命 名 规 则 为 模 1);//会将where条件注入到orm $this->getTotalNums();//调用Model中的getTotalNums() orm会使用上面注入的条件 //v2.7.3起,在model里还支持这么写。框架会自动处理请求的是db类的方法还是model的方法。如: $this->where('id', 1)->whereGt('status', 1)//这边操作的是orm下db类的方法 ->getTotalNums();0 码力 | 251 页 | 973.37 KB | 1 年前3CmlPHP v2.x 开发手册
17 1.6.17.1 1.6.17.2 1.6.18 1.6.19 1.6.20 1.6.21 1.6.22 1.6.23 注意事项 同时查询多个库 模型-MongoDB Orm详细Api 服务 视图 统一的API Html模板引擎 Blade模板引擎 锁-并发处理 缓存 语言包 日志 调试 Session自定义保存位置 框架自带的扩展包 插件 使用说明 \Cml\Http\Session::delete($name); 清空session \Cml\Http\Session::clear($name); 模型[mysql] 本小节介绍常用的orm mysql操作。详细的api 点这里 模型全部存 放在应用路径下的 Model 目录(可自定义只是建议命名为Model) 中,命名规则为 模型名 + Model (如 User 模型的文件名 会将where条件注入到orm $this->getTotalNums();//调用Model中的getTotalNums() orm会使用上面注入的条件 //v2.7.3起,在model里还支持这么写。框架会自动处理请求的是db类 的方法还是model的方法。如: $this->where('id', 1)->whereGt('status', 1)//这边操作 的是orm下db类的方法0 码力 | 245 页 | 720.67 KB | 1 年前3CmlPHP v2.x 开发手册
原生/子查询/union 快捷方法 通过某字段值获取数据 添加数据 通过某字段值更新数据 通过字段值删除数据 获取总数 获取列表 注意事项 同时查询多个库 模型-MongoDB Orm详细Api 服务 视图 统一的API Html模板引擎 Blade模板引擎 锁-并发处理 缓存 语言包 日志 调试 Session自定义保存位置 框架自带的扩展包 插件 使用说明 \Cml\Http\Session::delete($name); 清空session \Cml\Http\Session::clear($name); 43 模型[mysql] 本小节介绍常用的orm mysql操作。详细的api 点这里 模型全部存放在应用路径下的 Model 目录(可 自定义只是建议命名为Model)中,命名规则为 模型名 + Model (如 User 模型的文件名 1);//会将where条件注入到orm $this->getTotalNums();//调用Model中的getTotalNums() orm会使用上面注入的条件 //v2.7.3起,在model里还支持这么写。框架会自动处理请求的是db类的方法还是model的方法。如: $this->where('id', 1)->whereGt('status', 1)//这边操作的是orm下db类的方法 ->getTotalNums();0 码力 | 143 页 | 1.54 MB | 1 年前3
共 61 条
- 1
- 2
- 3
- 4
- 5
- 6
- 7