Skip to content

Yii 数据库访问、查询生成器和活动记录三者的关系 #1

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
git-zjx opened this issue Jun 18, 2019 · 0 comments
Open
Assignees
Labels
Tips Tips Yii Yii

Comments

@git-zjx
Copy link
Owner

git-zjx commented Jun 18, 2019

简介

数据库访问 DAO 为不同的数据库提供了一套统一的API
查询生成器 QueryBuilder 用于创建动态的查询语句
活动记录 ActiveRecord 提供了数据库与模型(MVC 中的 M,Model) 的交互

关系

查询生成器建立在 数据库访问 DAO 基础之上,可让你创建 程序化的、DBMS无关的SQL语句
yii\db\ActiveRecord::find() 创建的 查询生成器对象 yii\db\ActiveQuery 继承自 yii\db\Query 查询生成器,所以查询生成器的所有方法活动记录 ActiveRecord 都可以用

@git-zjx git-zjx added Tips Tips Yii Yii labels Jun 18, 2019
@git-zjx git-zjx self-assigned this Mar 2, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Tips Tips Yii Yii
Projects
None yet
Development

No branches or pull requests

1 participant