Skip to content
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

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

git-zjx opened this issue Jun 18, 2019 · 0 comments


Copy link

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 Yii labels Jun 18, 2019

@git-zjx git-zjx added this to 框架 in Yii Jul 11, 2019

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
1 participant
You can’t perform that action at this time.